﻿Imports System.Xml
Imports System.IO
Imports System.Text
Imports SQLtoASPX.Globals
Imports SQLtoASPX.Support
Imports System.Data.SqlClient
Imports System.Windows.Forms.DataGridView

Public Class DataTabPage
    Inherits System.Windows.Forms.TabPage

    Friend WithEvents SplitContainer As System.Windows.Forms.SplitContainer
    'Protected WithEvents grd As System.Windows.Forms.DataGridView
    Friend WithEvents ColumnName As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents DataType As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents ShowInMasterView As System.Windows.Forms.DataGridViewCheckBoxColumn
    Friend WithEvents ShowInDetailView As System.Windows.Forms.DataGridViewCheckBoxColumn
    Friend WithEvents SearchType As System.Windows.Forms.DataGridViewComboBoxColumn
    ' My New Field
    Friend WithEvents DataFormat As System.Windows.Forms.DataGridViewComboBoxColumn
    '/My New Field
    '   Friend WithEvents IsGroupColumn As System.Windows.Forms.DataGridViewCheckBoxColumn
    Friend WithEvents ColumnSize As System.Windows.Forms.DataGridViewTextBoxColumn
    '    Friend WithEvents AllowNulls As System.Windows.Forms.DataGridViewCheckBoxColumn
    Friend WithEvents IsIdentity As System.Windows.Forms.DataGridViewCheckBoxColumn
    Friend WithEvents cmdModifyLookup As System.Windows.Forms.DataGridViewButtonColumn
    Friend WithEvents LinkTableName As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents LinkTableKey As System.Windows.Forms.DataGridViewTextBoxColumn
    Friend WithEvents LinkTableValue As System.Windows.Forms.DataGridViewTextBoxColumn

    Friend WithEvents cmdCloseButton As New System.Windows.Forms.Button
    Friend WithEvents lblPrimaryKey As New System.Windows.Forms.Label

    Friend WithEvents grd As System.Windows.Forms.DataGridView
    Friend WithEvents cmdGenerate As System.Windows.Forms.Button

    Public DatabaseName As String = ""
    Public dt As DataTable = Nothing
    Public gTableName As String = ""
    Public gSchemaName As String = ""
    Public ServerName As String = ""

    Public DatabaseServer As DatabaseServer = Nothing
    Friend WithEvents mnuSelector As System.Windows.Forms.ContextMenuStrip
    Private components As System.ComponentModel.IContainer
    Friend WithEvents mnuSelectAll As System.Windows.Forms.ToolStripMenuItem
    Friend WithEvents mnuClearAll As System.Windows.Forms.ToolStripMenuItem

    Private mTreeNode As TreeNode
    Public Property TreeNode() As TreeNode
        Get
            Return mTreeNode
        End Get
        Set(ByVal value As TreeNode)
            mTreeNode = value
        End Set
    End Property

    Public Sub New()

        'Me.Controls.Add(New DataGridView)
        InitializeComponent()
    End Sub

    Private Function GetDataTable() As DataTable
        Dim dt As New DataTable
        Dim DataColumn As New DataColumn
        DataColumn.ColumnName = "ColumnName"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "DataType"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "ShowInMasterView"
        DataColumn.DataType = GetType(Boolean)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "ShowInDetailView"
        DataColumn.DataType = GetType(Boolean)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "SearchType"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "DataFormat"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "IsGroupColumn"
        DataColumn.DataType = GetType(Boolean)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "AllowNulls"
        DataColumn.DataType = GetType(Boolean)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "ColumnSize"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "IsIdentity"
        DataColumn.DataType = GetType(Boolean)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "ModifyLookup"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "LinkTableName"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "LinkTableKey"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)

        DataColumn = New DataColumn
        DataColumn.ColumnName = "LinkTableValue"
        DataColumn.DataType = GetType(String)
        dt.Columns.Add(DataColumn)
        Return dt
    End Function

    Private Function GetConnectionStringFromTreeNode(ByVal TreeNode As TreeNode) As String
        Dim CurrentNode As TreeNode = TreeNode
        Do While CurrentNode Is Nothing = False
            Dim DatabaseObject As DatabaseObject = CurrentNode.Tag
            If DatabaseObject.Type = DatabaseObjectType.Server Then
                Dim DatabaseServer As DatabaseServer = DatabaseObject
                Return DatabaseServer.ConnectionString
            Else
                'do nothing
            End If
            CurrentNode = CurrentNode.Parent
        Loop
        Return ""
    End Function


    Private Function GetDatabaseServerFromTreeNode(ByVal TreeNode As TreeNode) As DatabaseServer
        GetDatabaseServerFromTreeNode = Nothing
        Dim CurrentNode As TreeNode = TreeNode
        Do While CurrentNode Is Nothing = False
            Dim DatabaseObject As DatabaseObject = CurrentNode.Tag
            If DatabaseObject.Type = DatabaseObjectType.Server Then
                Return DatabaseObject
                'Dim DatabaseServer As DatabaseServer = DatabaseObject
                'Return DatabaseServer.ConnectionString
            Else
                'do nothing
            End If
            CurrentNode = CurrentNode.Parent
        Loop
        'Return ""
    End Function

    Public Sub LoadGrid(ByVal e As TreeNode)
        TreeNode = e

        Dim CurrentNode As TreeNode = e
        ' Dim CurrentTable As SQLtoASPX.Table = CurrentNode.Parent.Tag

        dt = GetDataTable()
        Dim ConnectionString As String = GetConnectionStringFromTreeNode(CurrentNode)
        DatabaseServer = GetDatabaseServerFromTreeNode(CurrentNode)
        Dim Connection As New SqlConnection(ConnectionString)
        Connection.Open()
        'Dim DB As SQLtoASPX.Database = CurrentNode.Parent.Tag
        DatabaseName = CurrentNode.Parent.Text
        ServerName = CurrentNode.Parent.Parent.Text

        gTableName = CurrentNode.Text
        Dim SearchTableName() As String = Split(gTableName, ".")
        gTableName = SearchTableName(1)
        gSchemaName = SearchTableName(0)

        Dim sql As String = "select * from " & DatabaseName & ".dbo.syscolumns c inner join " & DatabaseName & ".dbo.sysObjects o on o.id = c.id where o.Name = '" & SearchTableName(1) & "'"
        Dim Command As New SqlCommand(sql, Connection)
        Debug.Print(sql)

        Dim FileName As String = PCGColumn.StaticSafeParameterName(Me.ServerName) & "." & PCGColumn.SafeParameterNameDotSpaceToUnderScore(Me.DatabaseName) & "." & PCGColumn.SafeParameterNameDotSpaceToUnderScore(gTableName) & ".xml"
        Dim doc As XmlDocument = Nothing
        If System.IO.File.Exists(FileName) Then
            doc = New XmlDocument
            doc.Load(FileName)

        End If


        'Dim doc As New XmlDocument
        'doc.Load("Databasesv2.xml")

        Dim Reader As SqlDataReader = Nothing
        Try
            Reader = Command.ExecuteReader
        Catch ex As Exception
            Debug.WriteLine(ex.Message)
        End Try
        Do While Reader.Read
            Dim column As New Column(Reader)
            Dim dr As DataRow = dt.NewRow
            Dim IsIdentity As XmlElement = Nothing
            Dim ShowInMasterView As XmlElement = Nothing
            Dim ShowInDetailView As XmlElement = Nothing
            Dim SearchType As XmlElement = Nothing
            Dim LinkTableName As XmlElement = Nothing
            Dim LinkTableKey As XmlElement = Nothing
            Dim LinkTableValue As XmlElement = Nothing
            Dim DataFormat As XmlElement = Nothing

            If doc Is Nothing = False Then
                Try

                    Dim Key As XmlElement = doc.DocumentElement
                    Dim Node As XmlNode = Key.SelectSingleNode("Column[@Name='" & column.Name & "']")

                    IsIdentity = Node.SelectSingleNode("Field[@Name='IsIdentity']")
                    ShowInMasterView = Node.SelectSingleNode("Field[@Name='ShowInMasterView']")
                    ShowInDetailView = Node.SelectSingleNode("Field[@Name='ShowInDetailView']")
                    SearchType = Node.SelectSingleNode("Field[@Name='SearchType']")
                    LinkTableName = Node.SelectSingleNode("Field[@Name='LinkTableName']")
                    LinkTableValue = Node.SelectSingleNode("Field[@Name='LinkTableValue']")
                    LinkTableKey = Node.SelectSingleNode("Field[@Name='LinkTableKey']")
                    DataFormat = Node.SelectSingleNode("Field[@Name='DataFormat']")
                Catch ex As Exception

                End Try


            End If

            dr("ColumnName") = column.Name
            dr("DataType") = column.GetColumnTypeName
            If IsNothing(ShowInMasterView) = False Then
                Try
                    dr("ShowInMasterView") = ShowInMasterView.InnerText
                Catch ex As Exception

                End Try
            Else
                dr("ShowInMasterView") = column.ShowInMasterView
            End If

            If IsNothing(ShowInDetailView) = False Then
                Try
                    dr("ShowInDetailView") = ShowInDetailView.InnerText
                Catch ex As Exception

                End Try
            Else
                dr("ShowInDetailView") = column.ShowInDetailView
            End If

            If IsNothing(SearchType) = False Then
                Try
                    dr("SearchType") = SearchType.InnerText
                Catch ex As Exception

                End Try
            Else
                dr("SearchType") = column.SearchType
            End If

            If IsNothing(LinkTableName) = False Then
                Try
                    dr("LinkTableName") = LinkTableName.InnerText
                Catch ex As Exception

                End Try
            End If

            If IsNothing(LinkTableValue) = False Then
                Try
                    dr("LinkTableValue") = LinkTableValue.InnerText
                Catch ex As Exception

                End Try
            End If

            If IsNothing(LinkTableKey) = False Then
                Try
                    dr("LinkTableKey") = LinkTableKey.InnerText
                Catch ex As Exception

                End Try
            End If

            dr("IsGroupColumn") = column.IsGroupColumn
            dr("AllowNulls") = column.AllowNulls
            dr("ColumnSize") = column.Length
            If IsNothing(IsIdentity) = False Then
                Try
                    dr("IsIdentity") = IsIdentity.InnerText
                Catch ex As Exception

                End Try

            Else
                dr("IsIdentity") = column.IsIdentity
            End If

            dr("ModifyLookup") = "..."
            dt.Rows.Add(dr)
        Loop
        'grd = New DataGridView

        grd.DataSource = dt




        'Debug.WriteLine(grd.Rows(e.RowIndex).Cells(1).Value)
        'If grd.Rows(e.RowIndex).Cells(1).Value = "datetime" Then
        '    grd.Rows(e.RowIndex).Cells(7).Style.BackColor = Color.LightGreen
        '    Dim dgvcbc As DataGridViewComboBoxCell = grd.Rows(e.RowIndex).Cells(7)
        '    dgvcbc.Items.Clear()
        '    dgvcbc.Items.AddRange(New Object() {"", "date", "datetime"})
        '    'dgvcbc.Items.Add("Test")
        '    'dgvcbc.data()


        '    'grd.Rows(e.RowIndex).Cells(7)

        '    '.Items.AddRange(New Object() {"", "Both", "Exact", "Left", "Right"})
        '    'grd.Rows(e.RowIndex).Cells(7).
        'End If



        'Dim ParentNode As TreeNode = e.Parent
        'For Each Node As TreeNode In ParentNode.Nodes
        '    Dim tbl As SQLtoASPX.Table = Node.Tag
        '    If tbl.Name <> CurrentNode.Name Then
        '        'Dim cbo As New ComboBox
        '        'cbo.Items.Add("MOO")
        '        'cbo.Items.Add("Cow")
        '        'grd.Rows(2).Cells("grdCBOTableName").Value = cbo
        '    End If
        'Next

        'Dim Columns As Columns

        'If Tables.ContainsKey("T" & e.Node.Tag.id) Then
        '    Columns = Tables.Item("T" & e.Node.Tag.id)

        'Else
        '    Dim Connection As New SqlConnection(Globals.CS)
        '    Connection.Open()
        '    Dim Command As New SqlCommand("select * from syscolumns where id = " & e.Node.Tag.id, Connection)

        '    Dim Reader As SqlDataReader = Command.ExecuteReader

        '    Columns = New Columns(Reader)
        '    Tables.Add("T" & e.Node.Tag.id, Columns)

        '    Reader.Close()
        '    Connection.Close()

        'End If
        'grd.Rows.Clear()
        'For Each c As Column In Columns.ColumnList
        '    Dim RowID As Long = grd.Rows.Add()

        '    grd.Rows(RowID).Cells(0).Value = c.Name
        '    grd.Rows(RowID).Cells(1).Value = c.GetColumnTypeName

        '    Select Case c.GetColumnTypeName
        '        Case "autonumber"
        '        Case Else
        '            grd.Rows(RowID).Cells(2).Value = 1
        '            grd.Rows(RowID).Cells(3).Value = 1
        '    End Select

        'Next


    End Sub

    Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Me.ColumnName = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.DataType = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.ShowInMasterView = New System.Windows.Forms.DataGridViewCheckBoxColumn()
        Me.ShowInDetailView = New System.Windows.Forms.DataGridViewCheckBoxColumn()
        Me.SearchType = New System.Windows.Forms.DataGridViewComboBoxColumn()
        Me.DataFormat = New System.Windows.Forms.DataGridViewComboBoxColumn()
        Me.ColumnSize = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.IsIdentity = New System.Windows.Forms.DataGridViewCheckBoxColumn()
        Me.cmdModifyLookup = New System.Windows.Forms.DataGridViewButtonColumn()
        Me.cmdGenerate = New System.Windows.Forms.Button()
        Me.cmdCloseButton = New System.Windows.Forms.Button()
        Me.lblPrimaryKey = New System.Windows.Forms.Label()
        Me.LinkTableName = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.LinkTableKey = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.LinkTableValue = New System.Windows.Forms.DataGridViewTextBoxColumn()
        Me.grd = New System.Windows.Forms.DataGridView()
        Me.SplitContainer = New System.Windows.Forms.SplitContainer()
        Me.mnuSelector = New System.Windows.Forms.ContextMenuStrip(Me.components)
        Me.mnuSelectAll = New System.Windows.Forms.ToolStripMenuItem()
        Me.mnuClearAll = New System.Windows.Forms.ToolStripMenuItem()
        CType(Me.grd, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SplitContainer.Panel1.SuspendLayout()
        Me.SplitContainer.Panel2.SuspendLayout()
        Me.SplitContainer.SuspendLayout()
        Me.mnuSelector.SuspendLayout()
        Me.SuspendLayout()
        '
        'ColumnName
        '
        Me.ColumnName.DataPropertyName = "ColumnName"
        Me.ColumnName.HeaderText = "ColumnName"
        Me.ColumnName.Name = "ColumnName"
        Me.ColumnName.ReadOnly = True
        '
        'DataType
        '
        Me.DataType.DataPropertyName = "DataType"
        Me.DataType.HeaderText = "Type"
        Me.DataType.Name = "DataType"
        Me.DataType.ReadOnly = True
        Me.DataType.Width = 65
        '
        'ShowInMasterView
        '
        Me.ShowInMasterView.DataPropertyName = "ShowInMasterView"
        Me.ShowInMasterView.HeaderText = "Master View"
        Me.ShowInMasterView.Name = "ShowInMasterView"
        Me.ShowInMasterView.Width = 40
        '
        'ShowInDetailView
        '
        Me.ShowInDetailView.DataPropertyName = "ShowInDetailView"
        Me.ShowInDetailView.HeaderText = "Detail View"
        Me.ShowInDetailView.Name = "ShowInDetailView"
        Me.ShowInDetailView.Width = 40
        '
        'SearchType
        '
        Me.SearchType.DataPropertyName = "SearchType"
        Me.SearchType.HeaderText = "Search Type"
        Me.SearchType.Items.AddRange(New Object() {"", "Both", "Exact", "Left", "Right"})
        Me.SearchType.Name = "SearchType"
        Me.SearchType.Width = 55
        '
        'DataFormat
        '
        Me.DataFormat.DataPropertyName = "DataFormat"
        Me.DataFormat.HeaderText = "Data Format"
        Me.DataFormat.Name = "DataFormat"
        Me.DataFormat.Width = 150
        '
        'ColumnSize
        '
        Me.ColumnSize.DataPropertyName = "ColumnSize"
        Me.ColumnSize.HeaderText = "ColumnSize"
        Me.ColumnSize.Name = "ColumnSize"
        Me.ColumnSize.Visible = False
        '
        'IsIdentity
        '
        Me.IsIdentity.DataPropertyName = "IsIdentity"
        Me.IsIdentity.HeaderText = "Identity Column"
        Me.IsIdentity.Name = "IsIdentity"
        Me.IsIdentity.Width = 55
        '
        'cmdModifyLookup
        '
        Me.cmdModifyLookup.DataPropertyName = "ModifyLookup"
        Me.cmdModifyLookup.HeaderText = "Lookup Table"
        Me.cmdModifyLookup.Name = "cmdModifyLookup"
        Me.cmdModifyLookup.Width = 55
        '
        'cmdGenerate
        '
        Me.cmdGenerate.Anchor = System.Windows.Forms.AnchorStyles.Right
        Me.cmdGenerate.Location = New System.Drawing.Point(50, 10)
        Me.cmdGenerate.Name = "cmdGenerate"
        Me.cmdGenerate.Size = New System.Drawing.Size(75, 23)
        Me.cmdGenerate.TabIndex = 0
        Me.cmdGenerate.Text = "Generate"
        '
        'cmdCloseButton
        '
        Me.cmdCloseButton.Anchor = System.Windows.Forms.AnchorStyles.Right
        Me.cmdCloseButton.Location = New System.Drawing.Point(170, 5)
        Me.cmdCloseButton.Name = "cmdCloseButton"
        Me.cmdCloseButton.Size = New System.Drawing.Size(23, 23)
        Me.cmdCloseButton.TabIndex = 0
        Me.cmdCloseButton.Text = "X"
        '
        'lblPrimaryKey
        '
        Me.lblPrimaryKey.Location = New System.Drawing.Point(0, 0)
        Me.lblPrimaryKey.Name = "lblPrimaryKey"
        Me.lblPrimaryKey.Size = New System.Drawing.Size(100, 23)
        Me.lblPrimaryKey.TabIndex = 1
        '
        'LinkTableName
        '
        Me.LinkTableName.DataPropertyName = "LinkTableName"
        Me.LinkTableName.HeaderText = "Lookup Table"
        Me.LinkTableName.Name = "LinkTableName"
        '
        'LinkTableKey
        '
        Me.LinkTableKey.DataPropertyName = "LinkTableKey"
        Me.LinkTableKey.HeaderText = "Lookup Key"
        Me.LinkTableKey.Name = "LinkTableKey"
        '
        'LinkTableValue
        '
        Me.LinkTableValue.DataPropertyName = "LinkTableValue"
        Me.LinkTableValue.HeaderText = "Lookup Value"
        Me.LinkTableValue.Name = "LinkTableValue"
        '
        'grd
        '
        Me.grd.AllowUserToAddRows = False
        Me.grd.AllowUserToDeleteRows = False
        Me.grd.AutoGenerateColumns = False
        Me.grd.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
        Me.grd.Columns.AddRange(New System.Windows.Forms.DataGridViewColumn() {Me.ColumnName, Me.DataType, Me.ShowInMasterView, Me.ShowInDetailView, Me.SearchType, Me.ColumnSize, Me.IsIdentity, Me.DataFormat, Me.cmdModifyLookup, Me.LinkTableName, Me.LinkTableKey, Me.LinkTableValue})
        Me.grd.Dock = System.Windows.Forms.DockStyle.Fill
        Me.grd.Location = New System.Drawing.Point(0, 0)
        Me.grd.Name = "grd"
        Me.grd.Size = New System.Drawing.Size(200, 64)
        Me.grd.TabIndex = 0
        '
        'SplitContainer
        '
        Me.SplitContainer.Dock = System.Windows.Forms.DockStyle.Fill
        Me.SplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel1
        Me.SplitContainer.Location = New System.Drawing.Point(0, 0)
        Me.SplitContainer.Name = "SplitContainer"
        Me.SplitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal
        '
        'SplitContainer.Panel1
        '
        Me.SplitContainer.Panel1.Controls.Add(Me.cmdGenerate)
        Me.SplitContainer.Panel1.Controls.Add(Me.cmdCloseButton)
        Me.SplitContainer.Panel1.Controls.Add(Me.lblPrimaryKey)
        '
        'SplitContainer.Panel2
        '
        Me.SplitContainer.Panel2.Controls.Add(Me.grd)
        Me.SplitContainer.Size = New System.Drawing.Size(200, 100)
        Me.SplitContainer.SplitterDistance = 32
        Me.SplitContainer.TabIndex = 0
        '
        'mnuSelector
        '
        Me.mnuSelector.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuSelectAll, Me.mnuClearAll})
        Me.mnuSelector.Name = "mnuSelector"
        Me.mnuSelector.Size = New System.Drawing.Size(123, 48)
        '
        'mnuSelectAll
        '
        Me.mnuSelectAll.Name = "mnuSelectAll"
        Me.mnuSelectAll.Size = New System.Drawing.Size(122, 22)
        Me.mnuSelectAll.Text = "Select All"
        '
        'mnuClearAll
        '
        Me.mnuClearAll.Name = "mnuClearAll"
        Me.mnuClearAll.Size = New System.Drawing.Size(122, 22)
        Me.mnuClearAll.Text = "Clear All"
        '
        'DataTabPage
        '
        Me.Controls.Add(Me.SplitContainer)
        CType(Me.grd, System.ComponentModel.ISupportInitialize).EndInit()
        Me.SplitContainer.Panel1.ResumeLayout(False)
        Me.SplitContainer.Panel2.ResumeLayout(False)
        CType(Me.SplitContainer, System.ComponentModel.ISupportInitialize).EndInit()
        Me.SplitContainer.ResumeLayout(False)
        Me.mnuSelector.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

    Private Sub grd_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grd.CellClick
        'If e.RowIndex > 0 Then

        '    If e.ColumnIndex = 7 Then
        '        Select Case grd.Rows(e.RowIndex).Cells(1).Value
        '            Case "datetime"
        '                Dim frm As New frmDateFormat
        '                frm.Value = grd.Rows(e.RowIndex).Cells(7).Value.ToString
        '                frm.ShowDialog()

        '                If frm.Value.Length > 0 Then
        '                    grd.Rows(e.RowIndex).Cells(7).Value = frm.Value
        '                End If
        '                'Case Else
        '                '    Dim frm As New frmNumberFormat
        '                '    frm.ShowDialog()

        '        End Select
        '        'MsgBox(grd.Rows(e.RowIndex).Cells(1))
        '    End If
        'End If
    End Sub

    Private Sub grd_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles grd.CellContentClick
        If e.ColumnIndex = 8 Then
            Dim frm As New frmGetLookupTableSettings(GetConnectionStringFromTreeNode(TreeNode), TreeNode.Parent.Text)
            If IsDBNull(grd.CurrentRow.Cells(e.ColumnIndex + 1).Value) = False Then
                SetComboBoxValue(frm.cboTableName, grd.CurrentRow.Cells(e.ColumnIndex + 1).Value)
                SetComboBoxValue2(frm.cboDisplayColumn, grd.CurrentRow.Cells(e.ColumnIndex + 2).Value)
                SetComboBoxValue2(frm.cboReturnColumn, grd.CurrentRow.Cells(e.ColumnIndex + 3).Value)

                'frm.cboTableName.SelectedIndex = 2 ' = grd.CurrentRow.Cells(e.ColumnIndex + 1).Value
                'frm.cboTableName_SelectedIndexChanged(Nothing, Nothing)
                'frm.cboDisplayColumn.SelectedText = grd.CurrentRow.Cells(e.ColumnIndex + 2).Value
                'frm.cboReturnColumn.SelectedText = grd.CurrentRow.Cells(e.ColumnIndex + 3).Value
            End If
            frm.ShowDialog()
            If frm.OkClicked Then
                '  Debug.WriteLine("moo")
                grd.CurrentRow.Cells(e.ColumnIndex + 1).Value = frm.TableName
                grd.CurrentRow.Cells(e.ColumnIndex + 2).Value = frm.DisplayColumn
                grd.CurrentRow.Cells(e.ColumnIndex + 3).Value = frm.ReturnColumn
            End If
        End If
    End Sub

    Private Sub SetComboBoxValue(ByVal cbo As ComboBox, ByVal Value As String)
        For i As Long = 0 To cbo.Items.Count - 1
            If cbo.Items(i)(1).ToString.ToUpper = Value.ToUpper Then
                cbo.SelectedIndex = i
                Exit Sub
            End If
        Next
    End Sub
    Private Sub SetComboBoxValue2(ByVal cbo As ComboBox, ByVal Value As String)
        For i As Long = 0 To cbo.Items.Count - 1
            If cbo.Items(i).ToString.ToUpper = Value.ToUpper Then
                cbo.SelectedIndex = i
                Exit Sub
            End If
        Next
    End Sub

    Private Sub cmdGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdGenerate.Click

        Dim PrimaryKeyFound As Boolean = False
        For Each Row As DataGridViewRow In grd.Rows
            If Row.Cells(6).Value = "True" Then
                PrimaryKeyFound = True
                Exit For
            End If
        Next

        If PrimaryKeyFound = False Then

            lblPrimaryKey.Visible = True

            For Each Row As DataGridViewRow In grd.Rows
                Row.Cells(6).Style.BackColor = Color.PaleGoldenrod
            Next

            MsgBox("Identity column needs to be chosen, this needs to be a column that uniquely identifies a row")

            Exit Sub
        End If
444:
        Dim StartTickCount As Long = System.Environment.TickCount
        Logit("Generation Started at " & Now.ToString)

        'Config file
        SaveConfiguration()
        '/Config file

        If MasterForm.txtPath.Text.Length = 0 Then
            MasterForm.txtOutput.Text = "Unable to generate please set the output directory." & vbCrLf & MasterForm.txtOutput.Text
            MasterForm.txtPath.Focus()
            Exit Sub
        End If

        If Strings.Right(MasterForm.txtPath.Text, 1) = "\" Then
            MasterForm.txtPath.Text = Strings.Left(MasterForm.txtPath.Text, Len(MasterForm.txtPath.Text) - 1)
        End If

        If System.IO.Directory.Exists(MasterForm.txtPath.Text) = False Then
            If MsgBox("Directory : " & MasterForm.txtPath.Text & " does not exist do you want to create it?", MsgBoxStyle.YesNoCancel, "Create Directory " & MasterForm.txtPath.Text) = MsgBoxResult.Yes Then
                System.IO.Directory.CreateDirectory(MasterForm.txtPath.Text)
            Else
                Exit Sub
            End If
        End If

        If MasterForm.chkIncludeSourceCode.Checked Then
            'Dim tbl As Table = Node.Tag
            If MasterForm.chkDemoMode.Checked = False Then
                Dim pcg As New RawCreateScript(gTableName, dt, MasterForm.cboConnectionStringType.SelectedValue, MasterForm.txtConnectionString.Text, MasterForm.cboGridCodingStyle.SelectedValue, True, MasterForm.cboCodeType.SelectedValue, MasterForm.txtProjectName.Text, MasterForm.cboKeyPassing.SelectedValue, MasterForm.cboCommentLevel.SelectedValue, MasterForm.cboPaging.SelectedValue, MasterForm.chkSorting.Checked, "", gSchemaName)
                If Support.DownloadFile(pcg, MasterForm.txtPath.Text & "\", MasterForm.txtOutput) = False Then
                    'error happened
                    Exit Sub
                End If
            Else
                ProcessDemoMode()
            End If

        End If

        'If MasterForm.chkIncludeSupportFiles.Checked Then
        Dim FileName As String = MasterForm.txtPath.Text & "\PCGStyleSheet.css"
        Dim fs As System.IO.FileStream
        Dim AE As New ASCIIEncoding()
        Dim out As Byte()

        If System.IO.File.Exists(FileName) = False Then
            Try
                fs = New System.IO.FileStream(FileName, FileMode.Create)
            Catch ex As Exception
                MsgBox(ex.Message)
                Exit Sub
            End Try

            Dim PCGStyleSheet As New PCGStyleSheet
            out = AE.GetBytes(PCGStyleSheet.ToString)
            PCGStyleSheet = Nothing
            fs.Write(out, 0, out.Length)
            fs.Close()
            Logit("Created: " & FileName)
        Else
            Logit("File Already Exists: " & FileName)
            Logit("Checking Version: " & FileName)
            Dim Lines() As String = System.IO.File.ReadAllLines(FileName)
            Dim VersionOK As Boolean = False
            For Each Line As String In Lines
                If InStr(Line, "SQLtoASPX Version 2.0", CompareMethod.Text) > 0 Then
                    VersionOK = True
                    Exit For
                End If
            Next

            If VersionOK = False Then
                Logit("New Version: " & FileName)
                fs = New System.IO.FileStream(FileName, FileMode.Create)
                Dim PCGStyleSheet As New PCGStyleSheet
                out = AE.GetBytes(PCGStyleSheet.ToString)
                PCGStyleSheet = Nothing
                fs.Write(out, 0, out.Length)
                fs.Close()
                Logit("Created: " & FileName)
            Else
                Logit("Version OK: " & FileName)
            End If
        End If

        FileName = MasterForm.txtPath.Text & "\jquery.ui.datetimepicker.js"
        If System.IO.File.Exists(FileName) = False Then

            fs = New System.IO.FileStream(FileName, FileMode.Create)
            Dim JSCode As New JQueryUIDateTimePickerJS()
            out = AE.GetBytes(JSCode.ToString)
            JSCode = Nothing
            fs.Write(out, 0, out.Length)
            fs.Close()
            Logit("Created: " & FileName)
        Else
            Logit("File Already Exists: " & FileName)
        End If

        FileName = MasterForm.txtPath.Text & "\jquery.ui.button.js"
        If System.IO.File.Exists(FileName) = False Then

            fs = New System.IO.FileStream(FileName, FileMode.Create)
            Dim JSCode As New JQueryUIButtonJS()
            out = AE.GetBytes(JSCode.ToString)
            JSCode = Nothing
            fs.Write(out, 0, out.Length)
            fs.Close()
            Logit("Created: " & FileName)
        Else
            Logit("File Already Exists: " & FileName)
        End If


        'FileName = MasterForm.txtPath.Text & "\DatePicker.js"
        'fs = New System.IO.FileStream(FileName, FileMode.Create)
        'Dim dpjs As New DatePickerJS
        'out = AE.GetBytes(dpjs.ToString)
        'dpjs = Nothing
        'fs.Write(out, 0, out.Length)
        'fs.Close()
        'Logit("Created: " & FileName)

        FileName = MasterForm.txtPath.Text & "\Calendar.gif"

        If System.IO.File.Exists(FileName) = False Then
            Try
                fs = New System.IO.FileStream(FileName, FileMode.Create)
                WriteCalendarDotGifToFileStream(fs)
                fs.Close()
                Logit("Created: " & FileName)

                'System.IO.File.Copy("Calendar.gif", txtPath.Text & "\Calendar.gif")
            Catch ex As Exception
                MsgBox(ex.Message)
            End Try
        Else
            Logit("File Already Exists: " & FileName)
        End If

        'End If

        If MasterForm.chkIncludeWebConfigFile.Checked Then
            Dim swcf As New SampleWebConfigFile2008()

            FileName = MasterForm.txtPath.Text & "\Web.config"
            fs = New System.IO.FileStream(FileName, FileMode.Create)
            AE = New ASCIIEncoding()
            Dim PCGStyleSheet As New PCGStyleSheet

            'If LastNode Is Nothing = False Then
            '    DatabaseName = LastNode.Parent.Text
            'End If
            out = AE.GetBytes(swcf.GetConfigFile(MasterForm.cboConnectionStringType.Text, MasterForm.txtConnectionString.Text, Me, DatabaseName))
            PCGStyleSheet = Nothing
            fs.Write(out, 0, out.Length)
            fs.Close()
            swcf = Nothing
        End If

        'If MasterForm.chkIncludeButtonImages.Checked Then
        '    Dim FileName As String = ""
        '    FileName = MasterForm.txtPath.Text & "\Cancel.gif"
        '    Dim fs As FileStream = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteCancel(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\CancelA.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteCancelA(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\Delete.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteDelete(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\DeleteA.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteDeleteA(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\Save.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteSave(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\SaveA.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteSaveA(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\Search.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteSearch(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\SearchA.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteSearchA(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\AddNew.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteAddNew(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)

        '    FileName = MasterForm.txtPath.Text & "\AddNewA.gif"
        '    fs = New System.IO.FileStream(FileName, FileMode.Create)
        '    WriteAddNewA(fs)
        '    fs.Close()
        '    Logit("Created: " & FileName)
        'End If

        Logit("Generation Completed at " & Now.ToString)
        Logit("Generation Time: " & (System.Environment.TickCount - StartTickCount) & "ms")

        MsgBox("Generation Complete")
    End Sub

    Private Sub WriteAddNew(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H50)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H50)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H30)
        fs.WriteByte(&HA4)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H79)
        fs.WriteByte(&H58)
        fs.WriteByte(&H5F)
        fs.WriteByte(&H21)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H64)
        fs.WriteByte(&H69)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H68)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H29)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H84)
        fs.WriteByte(&H67)
        fs.WriteByte(&H30)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HF4)
        fs.WriteByte(&H70)
        fs.WriteByte(&H14)
        fs.WriteByte(&H2)
        fs.WriteByte(&H9D)
        fs.WriteByte(&H7)
        fs.WriteByte(&H5)
        fs.WriteByte(&HA0)
        fs.WriteByte(&HF)
        fs.WriteByte(&H84)
        fs.WriteByte(&H92)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H20)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HD)
        fs.WriteByte(&H0)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H1A)
        fs.WriteByte(&H50)
        fs.WriteByte(&H44)
        fs.WriteByte(&H98)
        fs.WriteByte(&HF1)
        fs.WriteByte(&H68)
        fs.WriteByte(&H2A)
        fs.WriteByte(&HD7)
        fs.WriteByte(&H67)
        fs.WriteByte(&H41)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H76)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HED)
        fs.WriteByte(&H72)
        fs.WriteByte(&H3)
        fs.WriteByte(&HAF)
        fs.WriteByte(&H5)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H4B)
        fs.WriteByte(&H52)
        fs.WriteByte(&H71)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H39)
        fs.WriteByte(&H33)
        fs.WriteByte(&H88)
        fs.WriteByte(&H94)
        fs.WriteByte(&H3)
        fs.WriteByte(&H5E)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H16)
        fs.WriteByte(&H24)
        fs.WriteByte(&HF9)
        fs.WriteByte(&HA0)
        fs.WriteByte(&H39)
        fs.WriteByte(&HA4)
        fs.WriteByte(&HEF)
        fs.WriteByte(&HD6)
        fs.WriteByte(&H44)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HA)
        fs.WriteByte(&H8)
        fs.WriteByte(&H33)
        fs.WriteByte(&H48)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H27)
        fs.WriteByte(&H69)
        fs.WriteByte(&H67)
        fs.WriteByte(&H88)
        fs.WriteByte(&H89)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H5)
        fs.WriteByte(&H87)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H28)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H90)
        fs.WriteByte(&H93)
        fs.WriteByte(&H90)
        fs.WriteByte(&H92)
        fs.WriteByte(&H27)
        fs.WriteByte(&H81)
        fs.WriteByte(&H82)
        fs.WriteByte(&H27)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H42)
        fs.WriteByte(&H4B)
        fs.WriteByte(&H76)
        fs.WriteByte(&H33)
        fs.WriteByte(&H37)
        fs.WriteByte(&H38)
        fs.WriteByte(&H47)
        fs.WriteByte(&H94)
        fs.WriteByte(&H22)
        fs.WriteByte(&H96)
        fs.WriteByte(&H25)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H37)
        fs.WriteByte(&H77)
        fs.WriteByte(&H5)
        fs.WriteByte(&H9)
        fs.WriteByte(&H7F)
        fs.WriteByte(&HA1)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H3)
        fs.WriteByte(&H9)
        fs.WriteByte(&H49)
        fs.WriteByte(&H75)
        fs.WriteByte(&H23)
        fs.WriteByte(&H43)
        fs.WriteByte(&H5)
        fs.WriteByte(&H35)
        fs.WriteByte(&H7E)
        fs.WriteByte(&H70)
        fs.WriteByte(&H5)
        fs.WriteByte(&H6)
        fs.WriteByte(&H71)
        fs.WriteByte(&H7D)
        fs.WriteByte(&H3)
        fs.WriteByte(&HB5)
        fs.WriteByte(&HB2)
        fs.WriteByte(&H26)
        fs.WriteByte(&HA5)
        fs.WriteByte(&HA3)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H65)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HC6)
        fs.WriteByte(&H51)
        fs.WriteByte(&H60)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HD2)
        fs.WriteByte(&HD3)
        fs.WriteByte(&HD4)
        fs.WriteByte(&HD5)
        fs.WriteByte(&H61)
        fs.WriteByte(&H5E)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HD9)
        fs.WriteByte(&HDA)
        fs.WriteByte(&HDB)
        fs.WriteByte(&H58)
        fs.WriteByte(&H60)
        fs.WriteByte(&H30)
        fs.WriteByte(&HC7)
        fs.WriteByte(&HE0)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H61)
        fs.WriteByte(&HE1)
        fs.WriteByte(&HE4)
        fs.WriteByte(&H91)
        fs.WriteByte(&HDE)
        fs.WriteByte(&H6A)
        fs.WriteByte(&HE5)
        fs.WriteByte(&HE9)
        fs.WriteByte(&HA4)
        fs.WriteByte(&HE7)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H46)
        fs.WriteByte(&H85)
        fs.WriteByte(&H25)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H9E)
        fs.WriteByte(&HBF)
        fs.WriteByte(&H49)
        fs.WriteByte(&H3)
        fs.WriteByte(&H8)
        fs.WriteByte(&H45)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HA3)
        fs.WriteByte(&HC5)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H35)
        fs.WriteByte(&H23)
        fs.WriteByte(&HBA)
        fs.WriteByte(&H71)
        fs.WriteByte(&HF1)
        fs.WriteByte(&H7)
        fs.WriteByte(&H80)
        fs.WriteByte(&HF8)
        fs.WriteByte(&H98)
        fs.WriteByte(&H77)
        fs.WriteByte(&H27)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H28)
        fs.WriteByte(&H24)
        fs.WriteByte(&H5)
        fs.WriteByte(&H64)
        fs.WriteByte(&H64)
        fs.WriteByte(&HF2)
        fs.WriteByte(&HF7)
        fs.WriteByte(&H66)
        fs.WriteByte(&H80)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H81)
        fs.WriteByte(&HE6)
        fs.WriteByte(&HC6)
        fs.WriteByte(&HA1)
        fs.WriteByte(&H60)
        fs.WriteByte(&H18)
        fs.WriteByte(&H30)
        fs.WriteByte(&H88)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H37)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H6A)
        fs.WriteByte(&H89)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H41)
        fs.WriteByte(&H70)
        fs.WriteByte(&H80)
        fs.WriteByte(&H80)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H79)
        fs.WriteByte(&H57)
        fs.WriteByte(&H34)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H58)
        fs.WriteByte(&HD5)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H90)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H1B)
        fs.WriteByte(&HAC)
        fs.WriteByte(&HC)
        fs.WriteByte(&HB1)
        fs.WriteByte(&H43)
        fs.WriteByte(&H1)
        fs.WriteByte(&H27)
        fs.WriteByte(&HE)
        fs.WriteByte(&H26)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H6)
        fs.WriteByte(&H33)
        fs.WriteByte(&H71)
        fs.WriteByte(&HE4)
        fs.WriteByte(&H44)
        fs.WriteByte(&H44)
        fs.WriteByte(&HA1)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H25)
        fs.WriteByte(&H80)
        fs.WriteByte(&H0)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HE5)
        fs.WriteByte(&H3)
        fs.WriteByte(&H56)
        fs.WriteByte(&HC4)
        fs.WriteByte(&H6F)
        fs.WriteByte(&HA6)
        fs.WriteByte(&H3C)
        fs.WriteByte(&HEE)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HE7)
        fs.WriteByte(&H2F)
        fs.WriteByte(&H40)
        fs.WriteByte(&H13)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H5)
        fs.WriteByte(&H2A)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H48)
        fs.WriteByte(&H4)
        fs.WriteByte(&H10)
        fs.WriteByte(&HCE)
        fs.WriteByte(&H82)
        fs.WriteByte(&H8)
        fs.WriteByte(&H73)
        fs.WriteByte(&HB1)
        fs.WriteByte(&H6A)
        fs.WriteByte(&H32)
        fs.WriteByte(&HF)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H75)
        fs.WriteByte(&HE9)
        fs.WriteByte(&HF4)
        fs.WriteByte(&H61)
        fs.WriteByte(&H1D)
        fs.WriteByte(&HA6)
        fs.WriteByte(&H75)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H6F)
        fs.WriteByte(&H1)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H1D)
        fs.WriteByte(&H4B)
        fs.WriteByte(&HB6)
        fs.WriteByte(&HAC)
        fs.WriteByte(&HD9)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H68)
        fs.WriteByte(&HD3)
        fs.WriteByte(&HAA)
        fs.WriteByte(&H5D)
        fs.WriteByte(&HAB)
        fs.WriteByte(&H20)
        fs.WriteByte(&H2)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteAddNewA(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H50)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H33)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H50)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H10)
        fs.WriteByte(&HA4)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H39)
        fs.WriteByte(&H40)
        fs.WriteByte(&H1F)
        fs.WriteByte(&H21)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H64)
        fs.WriteByte(&H69)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H68)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H29)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H84)
        fs.WriteByte(&H27)
        fs.WriteByte(&H20)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H10)
        fs.WriteByte(&H10)
        fs.WriteByte(&H1)
        fs.WriteByte(&H9D)
        fs.WriteByte(&H3)
        fs.WriteByte(&H84)
        fs.WriteByte(&H3C)
        fs.WriteByte(&HE7)
        fs.WriteByte(&H83)
        fs.WriteByte(&H92)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H86)
        fs.WriteByte(&H9B)
        fs.WriteByte(&HF1)
        fs.WriteByte(&H7C)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H20)
        fs.WriteByte(&H61)
        fs.WriteByte(&H60)
        fs.WriteByte(&H24)
        fs.WriteByte(&HD0)
        fs.WriteByte(&H54)
        fs.WriteByte(&HAE)
        fs.WriteByte(&HF)
        fs.WriteByte(&H62)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H76)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HDD)
        fs.WriteByte(&H2)
        fs.WriteByte(&H5E)
        fs.WriteByte(&H8)
        fs.WriteByte(&H96)
        fs.WriteByte(&H78)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H97)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HE1)
        fs.WriteByte(&H94)
        fs.WriteByte(&H71)
        fs.WriteByte(&H56)
        fs.WriteByte(&H10)
        fs.WriteByte(&HD5)
        fs.WriteByte(&H9A)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H9A)
        fs.WriteByte(&H72)
        fs.WriteByte(&H84)
        fs.WriteByte(&H14)
        fs.WriteByte(&H18)
        fs.WriteByte(&H76)
        fs.WriteByte(&H3D)
        fs.WriteByte(&HDB)
        fs.WriteByte(&H52)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H11)
        fs.WriteByte(&HA)
        fs.WriteByte(&H70)
        fs.WriteByte(&H2)
        fs.WriteByte(&H6D)
        fs.WriteByte(&H27)
        fs.WriteByte(&H68)
        fs.WriteByte(&H66)
        fs.WriteByte(&H86)
        fs.WriteByte(&H87)
        fs.WriteByte(&H88)
        fs.WriteByte(&H4)
        fs.WriteByte(&H85)
        fs.WriteByte(&H89)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H28)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H91)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H90)
        fs.WriteByte(&H27)
        fs.WriteByte(&H80)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H26)
        fs.WriteByte(&H78)
        fs.WriteByte(&H24)
        fs.WriteByte(&H32)
        fs.WriteByte(&H73)
        fs.WriteByte(&H22)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H44)
        fs.WriteByte(&H99)
        fs.WriteByte(&H92)
        fs.WriteByte(&H94)
        fs.WriteByte(&H25)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H37)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H4)
        fs.WriteByte(&H7)
        fs.WriteByte(&H33)
        fs.WriteByte(&H6)
        fs.WriteByte(&H45)
        fs.WriteByte(&H0)
        fs.WriteByte(&H6)
        fs.WriteByte(&H33)
        fs.WriteByte(&H7)
        fs.WriteByte(&H79)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H79)
        fs.WriteByte(&H1)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H34)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H6F)
        fs.WriteByte(&HA9)
        fs.WriteByte(&H80)
        fs.WriteByte(&H0)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H32)
        fs.WriteByte(&HAD)
        fs.WriteByte(&HB1)
        fs.WriteByte(&H24)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H92)
        fs.WriteByte(&HC1)
        fs.WriteByte(&H66)
        fs.WriteByte(&HC0)
        fs.WriteByte(&HC2)
        fs.WriteByte(&HC5)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H8)
        fs.WriteByte(&HA)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HD2)
        fs.WriteByte(&HD3)
        fs.WriteByte(&HD4)
        fs.WriteByte(&H60)
        fs.WriteByte(&H5D)
        fs.WriteByte(&HD7)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HD9)
        fs.WriteByte(&HDA)
        fs.WriteByte(&H57)
        fs.WriteByte(&H5F)
        fs.WriteByte(&H30)
        fs.WriteByte(&HC6)
        fs.WriteByte(&HDF)
        fs.WriteByte(&HC7)
        fs.WriteByte(&HDD)
        fs.WriteByte(&H69)
        fs.WriteByte(&HE0)
        fs.WriteByte(&HE4)
        fs.WriteByte(&H8F)
        fs.WriteByte(&HE2)
        fs.WriteByte(&HE5)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H26)
        fs.WriteByte(&HC4)
        fs.WriteByte(&H24)
        fs.WriteByte(&H39)
        fs.WriteByte(&H82)
        fs.WriteByte(&H27)
        fs.WriteByte(&HA0)
        fs.WriteByte(&H9D)
        fs.WriteByte(&H2)
        fs.WriteByte(&HB1)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H83)
        fs.WriteByte(&HF0)
        fs.WriteByte(&H93)
        fs.WriteByte(&HE7)
        fs.WriteByte(&H29)
        fs.WriteByte(&H75)
        fs.WriteByte(&H23)
        fs.WriteByte(&H96)
        fs.WriteByte(&H0)
        fs.WriteByte(&H78)
        fs.WriteByte(&H77)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H84)
        fs.WriteByte(&HD4)
        fs.WriteByte(&H5A)
        fs.WriteByte(&H15)
        fs.WriteByte(&HAF)
        fs.WriteByte(&H89)
        fs.WriteByte(&H25)
        fs.WriteByte(&H37)
        fs.WriteByte(&HEE)
        fs.WriteByte(&H2)
        fs.WriteByte(&H12)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H57)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HF)
        fs.WriteByte(&H90)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H68)
        fs.WriteByte(&HF5)
        fs.WriteByte(&HE1)
        fs.WriteByte(&H53)
        fs.WriteByte(&H64)
        fs.WriteByte(&H9E)
        fs.WriteByte(&HD)
        fs.WriteByte(&H20)
        fs.WriteByte(&H78)
        fs.WriteByte(&H9A)
        fs.WriteByte(&HA0)
        fs.WriteByte(&H12)
        fs.WriteByte(&HB0)
        fs.WriteByte(&HA7)
        fs.WriteByte(&H80)
        fs.WriteByte(&H27)
        fs.WriteByte(&H27)
        fs.WriteByte(&H1C)
        fs.WriteByte(&H4D)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H81)
        fs.WriteByte(&H51)
        fs.WriteByte(&H73)
        fs.WriteByte(&HB)
        fs.WriteByte(&H80)
        fs.WriteByte(&HA5)
        fs.WriteByte(&H2)
        fs.WriteByte(&H12)
        fs.WriteByte(&H41)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H78)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H49)
        fs.WriteByte(&HF)
        fs.WriteByte(&H92)
        fs.WriteByte(&H89)
        fs.WriteByte(&H3C)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H93)
        fs.WriteByte(&H97)
        fs.WriteByte(&H4B)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H91)
        fs.WriteByte(&HDE)
        fs.WriteByte(&H46)
        fs.WriteByte(&HE9)
        fs.WriteByte(&H29)
        fs.WriteByte(&H58)
        fs.WriteByte(&H80)
        fs.WriteByte(&HDF)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H2)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H6)
        fs.WriteByte(&H28)
        fs.WriteByte(&HA4)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H93)
        fs.WriteByte(&H5F)
        fs.WriteByte(&H41)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H22)
        fs.WriteByte(&HE)
        fs.WriteByte(&HEE)
        fs.WriteByte(&HF1)
        fs.WriteByte(&HF5)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H61)
        fs.WriteByte(&HBA)
        fs.WriteByte(&H74)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H1A)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H55)
        fs.WriteByte(&H58)
        fs.WriteByte(&H14)
        fs.WriteByte(&H0)
        fs.WriteByte(&H58)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H6A)
        fs.WriteByte(&HDD)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HB5)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HD7)
        fs.WriteByte(&HAF)
        fs.WriteByte(&H60)
        fs.WriteByte(&HC3)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H55)
        fs.WriteByte(&H10)
        fs.WriteByte(&H1)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteCancelA(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H66)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H30)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H28)
        fs.WriteByte(&H86)
        fs.WriteByte(&H44)
        fs.WriteByte(&H61)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H81)
        fs.WriteByte(&H30)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H6C)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H81)
        fs.WriteByte(&H1)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H9F)
        fs.WriteByte(&H2)
        fs.WriteByte(&HB6)
        fs.WriteByte(&HE5)
        fs.WriteByte(&H69)
        fs.WriteByte(&H24)
        fs.WriteByte(&H2A)
        fs.WriteByte(&HA1)
        fs.WriteByte(&HC7)
        fs.WriteByte(&H6)
        fs.WriteByte(&H42)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H36)
        fs.WriteByte(&H38)
        fs.WriteByte(&H85)
        fs.WriteByte(&H8A)
        fs.WriteByte(&HA7)
        fs.WriteByte(&H82)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H81)
        fs.WriteByte(&H34)
        fs.WriteByte(&H14)
        fs.WriteByte(&H8)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H21)
        fs.WriteByte(&H2D)
        fs.WriteByte(&H60)
        fs.WriteByte(&H5B)
        fs.WriteByte(&H58)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H76)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HED)
        fs.WriteByte(&H7A)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HD4)
        fs.WriteByte(&HDB)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H19)
        fs.WriteByte(&H35)
        fs.WriteByte(&HF1)
        fs.WriteByte(&H8)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H64)
        fs.WriteByte(&H49)
        fs.WriteByte(&H11)
        fs.WriteByte(&H46)
        fs.WriteByte(&HA0)
        fs.WriteByte(&H0)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H30)
        fs.WriteByte(&H1D)
        fs.WriteByte(&H4)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H83)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H54)
        fs.WriteByte(&H60)
        fs.WriteByte(&H8)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H42)
        fs.WriteByte(&H32)
        fs.WriteByte(&H53)
        fs.WriteByte(&H55)
        fs.WriteByte(&H67)
        fs.WriteByte(&H85)
        fs.WriteByte(&H86)
        fs.WriteByte(&H66)
        fs.WriteByte(&H69)
        fs.WriteByte(&HB)
        fs.WriteByte(&H87)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H23)
        fs.WriteByte(&H89)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H90)
        fs.WriteByte(&H87)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H9)
        fs.WriteByte(&H27)
        fs.WriteByte(&H8)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H0)
        fs.WriteByte(&H50)
        fs.WriteByte(&H31)
        fs.WriteByte(&H5)
        fs.WriteByte(&H40)
        fs.WriteByte(&H50)
        fs.WriteByte(&HC)
        fs.WriteByte(&H70)
        fs.WriteByte(&H27)
        fs.WriteByte(&H3C)
        fs.WriteByte(&H21)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H99)
        fs.WriteByte(&H51)
        fs.WriteByte(&H82)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H93)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H95)
        fs.WriteByte(&H41)
        fs.WriteByte(&HC)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H43)
        fs.WriteByte(&H1)
        fs.WriteByte(&H79)
        fs.WriteByte(&HA9)
        fs.WriteByte(&H44)
        fs.WriteByte(&H46)
        fs.WriteByte(&H76)
        fs.WriteByte(&HB0)
        fs.WriteByte(&H80)
        fs.WriteByte(&HB9)
        fs.WriteByte(&H23)
        fs.WriteByte(&H52)
        fs.WriteByte(&HAB)
        fs.WriteByte(&H61)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H91)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H65)
        fs.WriteByte(&HAC)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HC6)
        fs.WriteByte(&HBF)
        fs.WriteByte(&HA)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HD2)
        fs.WriteByte(&HD3)
        fs.WriteByte(&HD0)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H5F)
        fs.WriteByte(&HD7)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HD9)
        fs.WriteByte(&H5D)
        fs.WriteByte(&HC0)
        fs.WriteByte(&HC7)
        fs.WriteByte(&HDD)
        fs.WriteByte(&H2B)
        fs.WriteByte(&HC5)
        fs.WriteByte(&HDE)
        fs.WriteByte(&HC7)
        fs.WriteByte(&HE0)
        fs.WriteByte(&HE1)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HE3)
        fs.WriteByte(&H7E)
        fs.WriteByte(&H3A)
        fs.WriteByte(&H3A)
        fs.WriteByte(&H7)
        fs.WriteByte(&HE4)
        fs.WriteByte(&H30)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HDF)
        fs.WriteByte(&HDC)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H6C)
        fs.WriteByte(&HEA)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H79)
        fs.WriteByte(&HE9)
        fs.WriteByte(&HB6)
        fs.WriteByte(&HE8)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H73)
        fs.WriteByte(&H82)
        fs.WriteByte(&HBE)
        fs.WriteByte(&HEE)
        fs.WriteByte(&H84)
        fs.WriteByte(&HF0)
        fs.WriteByte(&HC)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H17)
        fs.WriteByte(&H0)
        fs.WriteByte(&H88)
        fs.WriteByte(&H1)
        fs.WriteByte(&H5B)
        fs.WriteByte(&H98)
        fs.WriteByte(&HE)
        fs.WriteByte(&HB2)
        fs.WriteByte(&H9)
        fs.WriteByte(&HB0)
        fs.WriteByte(&H82)
        fs.WriteByte(&H4D)
        fs.WriteByte(&HBE)
        fs.WriteByte(&H1)
        fs.WriteByte(&HFE)
        fs.WriteByte(&H1C)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H5B)
        fs.WriteByte(&HF1)
        fs.WriteByte(&H27)
        fs.WriteByte(&H1F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1)
        fs.WriteByte(&H7)
        fs.WriteByte(&H76)
        fs.WriteByte(&H30)
        fs.WriteByte(&H70)
        fs.WriteByte(&H85)
        fs.WriteByte(&H10)
        fs.WriteByte(&H49)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H7A)
        fs.WriteByte(&HA7)
        fs.WriteByte(&H21)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H28)
        fs.WriteByte(&HC2)
        fs.WriteByte(&HDC)
        fs.WriteByte(&HBA)
        fs.WriteByte(&H46)
        fs.WriteByte(&H26)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HA9)
        fs.WriteByte(&HD2)
        fs.WriteByte(&H10)
        fs.WriteByte(&HCB)
        fs.WriteByte(&H96)
        fs.WriteByte(&H67)
        fs.WriteByte(&HD2)
        fs.WriteByte(&H14)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H49)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H38)
        fs.WriteByte(&H73)
        fs.WriteByte(&HEA)
        fs.WriteByte(&HBC)
        fs.WriteByte(&HA9)
        fs.WriteByte(&H20)
        fs.WriteByte(&H2)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteCancel(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H30)
        fs.WriteByte(&H90)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H42)
        fs.WriteByte(&H28)
        fs.WriteByte(&H86)
        fs.WriteByte(&H49)
        fs.WriteByte(&H71)
        fs.WriteByte(&H9C)
        fs.WriteByte(&HC8)
        fs.WriteByte(&HA8)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H6)
        fs.WriteByte(&H7)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H7E)
        fs.WriteByte(&HA)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H96)
        fs.WriteByte(&HE7)
        fs.WriteByte(&H91)
        fs.WriteByte(&HA)
        fs.WriteByte(&H43)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H9)
        fs.WriteByte(&H98)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H70)
        fs.WriteByte(&HA)
        fs.WriteByte(&H11)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H5)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HF1)
        fs.WriteByte(&H50)
        fs.WriteByte(&H48)
        fs.WriteByte(&H8)
        fs.WriteByte(&H84)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H40)
        fs.WriteByte(&H6D)
        fs.WriteByte(&H41)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H76)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HAE)
        fs.WriteByte(&HB0)
        fs.WriteByte(&H78)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H16)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H23)
        fs.WriteByte(&H0)
        fs.WriteByte(&H73)
        fs.WriteByte(&HF5)
        fs.WriteByte(&H93)
        fs.WriteByte(&HF5)
        fs.WriteByte(&HE)
        fs.WriteByte(&HCF)
        fs.WriteByte(&H22)
        fs.WriteByte(&HC)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H32)
        fs.WriteByte(&HF0)
        fs.WriteByte(&H8A)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HA4)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H34)
        fs.WriteByte(&H80)
        fs.WriteByte(&HAE)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HB)
        fs.WriteByte(&H65)
        fs.WriteByte(&H82)
        fs.WriteByte(&H83)
        fs.WriteByte(&H64)
        fs.WriteByte(&H80)
        fs.WriteByte(&H84)
        fs.WriteByte(&H87)
        fs.WriteByte(&H88)
        fs.WriteByte(&H23)
        fs.WriteByte(&H86)
        fs.WriteByte(&H89)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H83)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H7)
        fs.WriteByte(&H3)
        fs.WriteByte(&H2)
        fs.WriteByte(&H44)
        fs.WriteByte(&H7A)
        fs.WriteByte(&H4B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H30)
        fs.WriteByte(&H5)
        fs.WriteByte(&H73)
        fs.WriteByte(&H93)
        fs.WriteByte(&H77)
        fs.WriteByte(&H28)
        fs.WriteByte(&H22)
        fs.WriteByte(&H6F)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H71)
        fs.WriteByte(&H32)
        fs.WriteByte(&H7F)
        fs.WriteByte(&H5F)
        fs.WriteByte(&H81)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H7C)
        fs.WriteByte(&H77)
        fs.WriteByte(&H49)
        fs.WriteByte(&H6D)
        fs.WriteByte(&H1)
        fs.WriteByte(&H6F)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H94)
        fs.WriteByte(&H78)
        fs.WriteByte(&H7)
        fs.WriteByte(&H76)
        fs.WriteByte(&H9)
        fs.WriteByte(&H7C)
        fs.WriteByte(&H75)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H7E)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H8D)
        fs.WriteByte(&HBB)
        fs.WriteByte(&H61)
        fs.WriteByte(&HBA)
        fs.WriteByte(&HBC)
        fs.WriteByte(&HBF)
        fs.WriteByte(&HB9)
        fs.WriteByte(&H52)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HC4)
        fs.WriteByte(&HC5)
        fs.WriteByte(&HC6)
        fs.WriteByte(&HC7)
        fs.WriteByte(&HC8)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H5D)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HD2)
        fs.WriteByte(&H5B)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HC0)
        fs.WriteByte(&HD6)
        fs.WriteByte(&HC1)
        fs.WriteByte(&H53)
        fs.WriteByte(&HD7)
        fs.WriteByte(&HDA)
        fs.WriteByte(&H66)
        fs.WriteByte(&HD5)
        fs.WriteByte(&HDB)
        fs.WriteByte(&HD6)
        fs.WriteByte(&HBE)
        fs.WriteByte(&H22)
        fs.WriteByte(&H39)
        fs.WriteByte(&H39)
        fs.WriteByte(&H76)
        fs.WriteByte(&HDE)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HA5)
        fs.WriteByte(&HD9)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H6A)
        fs.WriteByte(&HE4)
        fs.WriteByte(&H23)
        fs.WriteByte(&HA1)
        fs.WriteByte(&H27)
        fs.WriteByte(&H76)
        fs.WriteByte(&H42)
        fs.WriteByte(&HE2)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H39)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H50)
        fs.WriteByte(&HB8)
        fs.WriteByte(&H8A)
        fs.WriteByte(&HDD)
        fs.WriteByte(&H2A)
        fs.WriteByte(&HEA)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H7D)
        fs.WriteByte(&H91)
        fs.WriteByte(&H70)
        fs.WriteByte(&H50)
        fs.WriteByte(&H47)
        fs.WriteByte(&H4)
        fs.WriteByte(&HA8)
        fs.WriteByte(&HD9)
        fs.WriteByte(&H21)
        fs.WriteByte(&H42)
        fs.WriteByte(&H8D)
        fs.WriteByte(&HB8)
        fs.WriteByte(&H3)
        fs.WriteByte(&H4)
        fs.WriteByte(&HEE)
        fs.WriteByte(&H89)
        fs.WriteByte(&H0)
        fs.WriteByte(&H17)
        fs.WriteByte(&HE2)
        fs.WriteByte(&H60)
        fs.WriteByte(&HC)
        fs.WriteByte(&H1)
        fs.WriteByte(&H6)
        fs.WriteByte(&H74)
        fs.WriteByte(&H8)
        fs.WriteByte(&H88)
        fs.WriteByte(&HF4)
        fs.WriteByte(&H2A)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H12)
        fs.WriteByte(&H77)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H4E)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H50)
        fs.WriteByte(&H18)
        fs.WriteByte(&H82)
        fs.WriteByte(&H61)
        fs.WriteByte(&H39)
        fs.WriteByte(&H44)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H19)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H12)
        fs.WriteByte(&HA)
        fs.WriteByte(&H29)
        fs.WriteByte(&H52)
        fs.WriteByte(&H10)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H92)
        fs.WriteByte(&H85)
        fs.WriteByte(&HBE)
        fs.WriteByte(&H4)
        fs.WriteByte(&H58)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HB2)
        fs.WriteByte(&HA5)
        fs.WriteByte(&HCB)
        fs.WriteByte(&H97)
        fs.WriteByte(&H30)
        fs.WriteByte(&H63)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H9C)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H52)
        fs.WriteByte(&H41)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteDeleteA(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H66)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H10)
        fs.WriteByte(&H94)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H28)
        fs.WriteByte(&H32)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H60)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H3)
        fs.WriteByte(&H31)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H30)
        fs.WriteByte(&H8)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H98)
        fs.WriteByte(&H98)
        fs.WriteByte(&H6A)
        fs.WriteByte(&H1C)
        fs.WriteByte(&H7F)
        fs.WriteByte(&HA)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H96)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H90)
        fs.WriteByte(&H88)
        fs.WriteByte(&HBC)
        fs.WriteByte(&H41)
        fs.WriteByte(&H0)
        fs.WriteByte(&H11)
        fs.WriteByte(&H72)
        fs.WriteByte(&HC1)
        fs.WriteByte(&H48)
        fs.WriteByte(&HA7)
        fs.WriteByte(&H61)
        fs.WriteByte(&H88)
        fs.WriteByte(&H20)
        fs.WriteByte(&H30)
        fs.WriteByte(&H19)
        fs.WriteByte(&H18)
        fs.WriteByte(&H89)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H36)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H79)
        fs.WriteByte(&H16)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H76)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HED)
        fs.WriteByte(&H7A)
        fs.WriteByte(&HBF)
        fs.WriteByte(&H60)
        fs.WriteByte(&H2D)
        fs.WriteByte(&H20)
        fs.WriteByte(&HB7)
        fs.WriteByte(&HB0)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HE8)
        fs.WriteByte(&HB4)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HDE)
        fs.WriteByte(&H99)
        fs.WriteByte(&HA)
        fs.WriteByte(&H45)
        fs.WriteByte(&H13)
        fs.WriteByte(&HC3)
        fs.WriteByte(&H74)
        fs.WriteByte(&H60)
        fs.WriteByte(&H10)
        fs.WriteByte(&H9C)
        fs.WriteByte(&HAD)
        fs.WriteByte(&HD7)
        fs.WriteByte(&H7C)
        fs.WriteByte(&H50)
        fs.WriteByte(&HBF)
        fs.WriteByte(&HF)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H3C)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H3C)
        fs.WriteByte(&H44)
        fs.WriteByte(&H81)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H6A)
        fs.WriteByte(&H88)
        fs.WriteByte(&H89)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H87)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H92)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H91)
        fs.WriteByte(&H23)
        fs.WriteByte(&H3C)
        fs.WriteByte(&H70)
        fs.WriteByte(&H7B)
        fs.WriteByte(&H3)
        fs.WriteByte(&H21)
        fs.WriteByte(&H5)
        fs.WriteByte(&H27)
        fs.WriteByte(&H7)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H79)
        fs.WriteByte(&H47)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H74)
        fs.WriteByte(&H3F)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H78)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H27)
        fs.WriteByte(&H0)
        fs.WriteByte(&H37)
        fs.WriteByte(&H63)
        fs.WriteByte(&H3A)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H97)
        fs.WriteByte(&HC)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H30)
        fs.WriteByte(&H74)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H46)
        fs.WriteByte(&H7B)
        fs.WriteByte(&H75)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H34)
        fs.WriteByte(&H48)
        fs.WriteByte(&H3)
        fs.WriteByte(&H44)
        fs.WriteByte(&H66)
        fs.WriteByte(&H95)
        fs.WriteByte(&H93)
        fs.WriteByte(&HBE)
        fs.WriteByte(&H68)
        fs.WriteByte(&HBD)
        fs.WriteByte(&HBF)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H90)
        fs.WriteByte(&H63)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HC7)
        fs.WriteByte(&HC8)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H57)
        fs.WriteByte(&H61)
        fs.WriteByte(&HD3)
        fs.WriteByte(&HD4)
        fs.WriteByte(&HD5)
        fs.WriteByte(&H5E)
        fs.WriteByte(&HAB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HDA)
        fs.WriteByte(&H86)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HDB)
        fs.WriteByte(&HDE)
        fs.WriteByte(&H22)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HB9)
        fs.WriteByte(&H27)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H68)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H67)
        fs.WriteByte(&H4)
        fs.WriteByte(&H6)
        fs.WriteByte(&H54)
        fs.WriteByte(&H69)
        fs.WriteByte(&HE1)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H3C)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H66)
        fs.WriteByte(&HE6)
        fs.WriteByte(&H36)
        fs.WriteByte(&H85)
        fs.WriteByte(&H88)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H6F)
        fs.WriteByte(&H71)
        fs.WriteByte(&H9A)
        fs.WriteByte(&H41)
        fs.WriteByte(&H27)
        fs.WriteByte(&H3F)
        fs.WriteByte(&HB4)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H26)
        fs.WriteByte(&H9)
        fs.WriteByte(&HA5)
        fs.WriteByte(&H7F)
        fs.WriteByte(&H8)
        fs.WriteByte(&HB8)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H41)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H4C)
        fs.WriteByte(&HC)
        fs.WriteByte(&H57)
        fs.WriteByte(&H99)
        fs.WriteByte(&H32)
        fs.WriteByte(&H11)
        fs.WriteByte(&HA4)
        fs.WriteByte(&H85)
        fs.WriteByte(&H62)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H41)
        fs.WriteByte(&HD)
        fs.WriteByte(&HFD)
        fs.WriteByte(&H71)
        fs.WriteByte(&H33)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H26)
        fs.WriteByte(&H22)
        fs.WriteByte(&HC4)
        fs.WriteByte(&H86)
        fs.WriteByte(&H44)
        fs.WriteByte(&HF8)
        fs.WriteByte(&H45)
        fs.WriteByte(&H24)
        fs.WriteByte(&H52)
        fs.WriteByte(&HA)
        fs.WriteByte(&H80)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H86)
        fs.WriteByte(&HB6)
        fs.WriteByte(&H1F)
        fs.WriteByte(&HAA)
        fs.WriteByte(&H74)
        fs.WriteByte(&HFB)
        fs.WriteByte(&HE6)
        fs.WriteByte(&H2D)
        fs.WriteByte(&H1C)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H49)
        fs.WriteByte(&H26)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HA9)
        fs.WriteByte(&H92)
        fs.WriteByte(&HD2)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H0)
        fs.WriteByte(&H30)
        fs.WriteByte(&H63)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H49)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H38)
        fs.WriteByte(&H69)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H88)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteDelete(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H10)
        fs.WriteByte(&H90)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H45)
        fs.WriteByte(&H28)
        fs.WriteByte(&H16)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H60)
        fs.WriteByte(&H9E)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H86)
        fs.WriteByte(&HC1)
        fs.WriteByte(&H20)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H23)
        fs.WriteByte(&H62)
        fs.WriteByte(&HC2)
        fs.WriteByte(&H74)
        fs.WriteByte(&HF1)
        fs.WriteByte(&H29)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H42)
        fs.WriteByte(&H22)
        fs.WriteByte(&HEE)
        fs.WriteByte(&H83)
        fs.WriteByte(&H0)
        fs.WriteByte(&H82)
        fs.WriteByte(&HE5)
        fs.WriteByte(&HA)
        fs.WriteByte(&H1)
        fs.WriteByte(&H85)
        fs.WriteByte(&H22)
        fs.WriteByte(&H81)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H50)
        fs.WriteByte(&H48)
        fs.WriteByte(&H28)
        fs.WriteByte(&H97)
        fs.WriteByte(&HB0)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H67)
        fs.WriteByte(&H41)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H76)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HB5)
        fs.WriteByte(&H2)
        fs.WriteByte(&H70)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H9A)
        fs.WriteByte(&H78)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H8B)
        fs.WriteByte(&HA4)
        fs.WriteByte(&H61)
        fs.WriteByte(&H9D)
        fs.WriteByte(&H89)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H99)
        fs.WriteByte(&HE)
        fs.WriteByte(&H21)
        fs.WriteByte(&H68)
        fs.WriteByte(&HEB)
        fs.WriteByte(&HF5)
        fs.WriteByte(&H8E)
        fs.WriteByte(&HF)
        fs.WriteByte(&H98)
        fs.WriteByte(&H3B)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H69)
        fs.WriteByte(&H68)
        fs.WriteByte(&H98)
        fs.WriteByte(&HA9)
        fs.WriteByte(&HD0)
        fs.WriteByte(&H66)
        fs.WriteByte(&H81)
        fs.WriteByte(&H82)
        fs.WriteByte(&H65)
        fs.WriteByte(&H80)
        fs.WriteByte(&H83)
        fs.WriteByte(&H86)
        fs.WriteByte(&H87)
        fs.WriteByte(&H67)
        fs.WriteByte(&H5F)
        fs.WriteByte(&H39)
        fs.WriteByte(&H88)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H81)
        fs.WriteByte(&H85)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H5)
        fs.WriteByte(&H27)
        fs.WriteByte(&H21)
        fs.WriteByte(&H4)
        fs.WriteByte(&H27)
        fs.WriteByte(&H7)
        fs.WriteByte(&H43)
        fs.WriteByte(&H5)
        fs.WriteByte(&H73)
        fs.WriteByte(&H95)
        fs.WriteByte(&H97)
        fs.WriteByte(&H43)
        fs.WriteByte(&H96)
        fs.WriteByte(&H27)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H5)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H77)
        fs.WriteByte(&H51)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H69)
        fs.WriteByte(&H90)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H5)
        fs.WriteByte(&H9F)
        fs.WriteByte(&H74)
        fs.WriteByte(&H3)
        fs.WriteByte(&H70)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H75)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H29)
        fs.WriteByte(&H24)
        fs.WriteByte(&H7B)
        fs.WriteByte(&H62)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H8D)
        fs.WriteByte(&HB8)
        fs.WriteByte(&HB6)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HB9)
        fs.WriteByte(&HBC)
        fs.WriteByte(&H35)
        fs.WriteByte(&H37)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HC2)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HC4)
        fs.WriteByte(&HC5)
        fs.WriteByte(&HC6)
        fs.WriteByte(&HC7)
        fs.WriteByte(&HC8)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HC6)
        fs.WriteByte(&H53)
        fs.WriteByte(&H5D)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HCF)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HBB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&HD3)
        fs.WriteByte(&H23)
        fs.WriteByte(&HB7)
        fs.WriteByte(&HD4)
        fs.WriteByte(&HBD)
        fs.WriteByte(&HD6)
        fs.WriteByte(&H7A)
        fs.WriteByte(&H3C)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H62)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H63)
        fs.WriteByte(&HA1)
        fs.WriteByte(&H66)
        fs.WriteByte(&HD9)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H3)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H3B)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H30)
        fs.WriteByte(&HDE)
        fs.WriteByte(&H34)
        fs.WriteByte(&H79)
        fs.WriteByte(&H8E)
        fs.WriteByte(&HD2)
        fs.WriteByte(&HB2)
        fs.WriteByte(&H92)
        fs.WriteByte(&H2D)
        fs.WriteByte(&H29)
        fs.WriteByte(&H40)
        fs.WriteByte(&H27)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H9B)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H26)
        fs.WriteByte(&H9)
        fs.WriteByte(&H9F)
        fs.WriteByte(&H72)
        fs.WriteByte(&H28)
        fs.WriteByte(&H45)
        fs.WriteByte(&H7F)
        fs.WriteByte(&HED)
        fs.WriteByte(&H23)
        fs.WriteByte(&H91)
        fs.WriteByte(&H76)
        fs.WriteByte(&HDC)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H2)
        fs.WriteByte(&H6B)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H75)
        fs.WriteByte(&HF6)
        fs.WriteByte(&H6A)
        fs.WriteByte(&H55)
        fs.WriteByte(&HF3)
        fs.WriteByte(&HF7)
        fs.WriteByte(&H63)
        fs.WriteByte(&HE0)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H84)
        fs.WriteByte(&H43)
        fs.WriteByte(&HEA)
        fs.WriteByte(&HD)
        fs.WriteByte(&HF4)
        fs.WriteByte(&H4)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HD3)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H57)
        fs.WriteByte(&HB)
        fs.WriteByte(&HC1)
        fs.WriteByte(&H5C)
        fs.WriteByte(&HBB)
        fs.WriteByte(&H26)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H23)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H15)
        fs.WriteByte(&HF)
        fs.WriteByte(&H81)
        fs.WriteByte(&HC)
        fs.WriteByte(&H39)
        fs.WriteByte(&H48)
        fs.WriteByte(&HA)
        fs.WriteByte(&H80)
        fs.WriteByte(&H93)
        fs.WriteByte(&H28)
        fs.WriteByte(&H53)
        fs.WriteByte(&HAA)
        fs.WriteByte(&H5C)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HB2)
        fs.WriteByte(&HA5)
        fs.WriteByte(&HCB)
        fs.WriteByte(&H97)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H15)
        fs.WriteByte(&H44)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteSaveA(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H66)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFD)
        fs.WriteByte(&H10)
        fs.WriteByte(&HA4)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H28)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H24)
        fs.WriteByte(&H10)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H86)
        fs.WriteByte(&H40)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H6C)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H86)
        fs.WriteByte(&H9F)
        fs.WriteByte(&H2)
        fs.WriteByte(&HBE)
        fs.WriteByte(&HE2)
        fs.WriteByte(&H60)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H5)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HC)
        fs.WriteByte(&HC6)
        fs.WriteByte(&H89)
        fs.WriteByte(&H14)
        fs.WriteByte(&H1)
        fs.WriteByte(&H40)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H54)
        fs.WriteByte(&H10)
        fs.WriteByte(&H9)
        fs.WriteByte(&H7A)
        fs.WriteByte(&H81)
        fs.WriteByte(&H1C)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H14)
        fs.WriteByte(&HF3)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H9E)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H74)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HAF)
        fs.WriteByte(&H51)
        fs.WriteByte(&H80)
        fs.WriteByte(&H6C)
        fs.WriteByte(&HB1)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H7A)
        fs.WriteByte(&HBF)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H26)
        fs.WriteByte(&HD7)
        fs.WriteByte(&H7B)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HD)
        fs.WriteByte(&H8)
        fs.WriteByte(&HA7)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H24)
        fs.WriteByte(&H58)
        fs.WriteByte(&H7)
        fs.WriteByte(&H4)
        fs.WriteByte(&H88)
        fs.WriteByte(&H40)
        fs.WriteByte(&HE2)
        fs.WriteByte(&H16)
        fs.WriteByte(&H2)
        fs.WriteByte(&HA)
        fs.WriteByte(&H97)
        fs.WriteByte(&H62)
        fs.WriteByte(&HB0)
        fs.WriteByte(&H7E)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HF3)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H7B)
        fs.WriteByte(&H7E)
        fs.WriteByte(&H80)
        fs.WriteByte(&H83)
        fs.WriteByte(&H5D)
        fs.WriteByte(&H82)
        fs.WriteByte(&H34)
        fs.WriteByte(&H71)
        fs.WriteByte(&H6)
        fs.WriteByte(&HC)
        fs.WriteByte(&H68)
        fs.WriteByte(&H72)
        fs.WriteByte(&HC)
        fs.WriteByte(&H2)
        fs.WriteByte(&H40)
        fs.WriteByte(&H27)
        fs.WriteByte(&H3A)
        fs.WriteByte(&H3D)
        fs.WriteByte(&H7)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H69)
        fs.WriteByte(&H47)
        fs.WriteByte(&H28)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H85)
        fs.WriteByte(&H5A)
        fs.WriteByte(&H33)
        fs.WriteByte(&H34)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H8)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H27)
        fs.WriteByte(&H7)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H1)
        fs.WriteByte(&H93)
        fs.WriteByte(&H37)
        fs.WriteByte(&H3)
        fs.WriteByte(&H7A)
        fs.WriteByte(&H86)
        fs.WriteByte(&H84)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H7D)
        fs.WriteByte(&H9A)
        fs.WriteByte(&H63)
        fs.WriteByte(&HAE)
        fs.WriteByte(&HB2)
        fs.WriteByte(&H24)
        fs.WriteByte(&H31)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HB7)
        fs.WriteByte(&HB8)
        fs.WriteByte(&HB9)
        fs.WriteByte(&HBA)
        fs.WriteByte(&HBB)
        fs.WriteByte(&HBC)
        fs.WriteByte(&HBD)
        fs.WriteByte(&HBE)
        fs.WriteByte(&HBF)
        fs.WriteByte(&HBC)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H58)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HC4)
        fs.WriteByte(&HC5)
        fs.WriteByte(&H55)
        fs.WriteByte(&HB0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H4C)
        fs.WriteByte(&HC8)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HAC)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H84)
        fs.WriteByte(&HCF)
        fs.WriteByte(&H2D)
        fs.WriteByte(&H65)
        fs.WriteByte(&H27)
        fs.WriteByte(&H1)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HD0)
        fs.WriteByte(&H61)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H4B)
        fs.WriteByte(&H65)
        fs.WriteByte(&H0)
        fs.WriteByte(&H77)
        fs.WriteByte(&H6E)
        fs.WriteByte(&HD5)
        fs.WriteByte(&HD6)
        fs.WriteByte(&H74)
        fs.WriteByte(&H26)
        fs.WriteByte(&H8)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H4)
        fs.WriteByte(&H2)
        fs.WriteByte(&H69)
        fs.WriteByte(&H99)
        fs.WriteByte(&H5B)
        fs.WriteByte(&H7A)
        fs.WriteByte(&H2)
        fs.WriteByte(&H37)
        fs.WriteByte(&H42)
        fs.WriteByte(&H36)
        fs.WriteByte(&H65)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H71)
        fs.WriteByte(&HA9)
        fs.WriteByte(&H7)
        fs.WriteByte(&HE0)
        fs.WriteByte(&HA0)
        fs.WriteByte(&HE9)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H34)
        fs.WriteByte(&HF4)
        fs.WriteByte(&HF5)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H49)
        fs.WriteByte(&HC)
        fs.WriteByte(&H9)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H21)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HA9)
        fs.WriteByte(&HF8)
        fs.WriteByte(&H26)
        fs.WriteByte(&HF0)
        fs.WriteByte(&H5E)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H6C)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H21)
        fs.WriteByte(&H1C)
        fs.WriteByte(&H24)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HE1)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H85)
        fs.WriteByte(&HE)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H34)
        fs.WriteByte(&HE9)
        fs.WriteByte(&H46)
        fs.WriteByte(&HB1)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HC5)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H18)
        fs.WriteByte(&H33)
        fs.WriteByte(&H6A)
        fs.WriteByte(&HDC)
        fs.WriteByte(&H88)
        fs.WriteByte(&H51)
        fs.WriteByte(&H41)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteSave(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HF7)
        fs.WriteByte(&H10)
        fs.WriteByte(&HA4)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H43)
        fs.WriteByte(&H28)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H24)
        fs.WriteByte(&H10)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H85)
        fs.WriteByte(&H40)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H6C)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H86)
        fs.WriteByte(&H9F)
        fs.WriteByte(&H2)
        fs.WriteByte(&HBE)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H71)
        fs.WriteByte(&H6)
        fs.WriteByte(&H84)
        fs.WriteByte(&H3A)
        fs.WriteByte(&H14)
        fs.WriteByte(&H27)
        fs.WriteByte(&H42)
        fs.WriteByte(&H4)
        fs.WriteByte(&H80)
        fs.WriteByte(&H90)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H20)
        fs.WriteByte(&H12)
        fs.WriteByte(&HF0)
        fs.WriteByte(&H70)
        fs.WriteByte(&H3A)
        fs.WriteByte(&HDA)
        fs.WriteByte(&H20)
        fs.WriteByte(&HE6)
        fs.WriteByte(&H59)
        fs.WriteByte(&H38)
        fs.WriteByte(&H9F)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H74)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HAD)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HA1)
        fs.WriteByte(&H0)
        fs.WriteByte(&HD9)
        fs.WriteByte(&H42)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HED)
        fs.WriteByte(&H7A)
        fs.WriteByte(&H47)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HD7)
        fs.WriteByte(&H76)
        fs.WriteByte(&H23)
        fs.WriteByte(&HA)
        fs.WriteByte(&H4E)
        fs.WriteByte(&HA1)
        fs.WriteByte(&H93)
        fs.WriteByte(&HEA)
        fs.WriteByte(&H74)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&H12)
        fs.WriteByte(&HA6)
        fs.WriteByte(&H40)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H17)
        fs.WriteByte(&H54)
        fs.WriteByte(&H86)
        fs.WriteByte(&HBF)
        fs.WriteByte(&HF8)
        fs.WriteByte(&H3C)
        fs.WriteByte(&HEB)
        fs.WriteByte(&HAE)
        fs.WriteByte(&HEF)
        fs.WriteByte(&HE7)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H7E)
        fs.WriteByte(&H81)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H80)
        fs.WriteByte(&H34)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H5)
        fs.WriteByte(&H3)
        fs.WriteByte(&H67)
        fs.WriteByte(&H6F)
        fs.WriteByte(&H88)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H6A)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H1)
        fs.WriteByte(&H6)
        fs.WriteByte(&H3)
        fs.WriteByte(&H7)
        fs.WriteByte(&H68)
        fs.WriteByte(&H7)
        fs.WriteByte(&H47)
        fs.WriteByte(&H29)
        fs.WriteByte(&H5D)
        fs.WriteByte(&H84)
        fs.WriteByte(&H2F)
        fs.WriteByte(&H3D)
        fs.WriteByte(&H69)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H89)
        fs.WriteByte(&H41)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H89)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H3)
        fs.WriteByte(&H71)
        fs.WriteByte(&H7F)
        fs.WriteByte(&H59)
        fs.WriteByte(&H33)
        fs.WriteByte(&H82)
        fs.WriteByte(&HA7)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H98)
        fs.WriteByte(&HA8)
        fs.WriteByte(&HAB)
        fs.WriteByte(&H30)
        fs.WriteByte(&H59)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HB0)
        fs.WriteByte(&HB1)
        fs.WriteByte(&HB2)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HB4)
        fs.WriteByte(&HB5)
        fs.WriteByte(&HB6)
        fs.WriteByte(&HB7)
        fs.WriteByte(&HB8)
        fs.WriteByte(&HB5)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H57)
        fs.WriteByte(&HBC)
        fs.WriteByte(&HBD)
        fs.WriteByte(&HBE)
        fs.WriteByte(&H54)
        fs.WriteByte(&HA5)
        fs.WriteByte(&H62)
        fs.WriteByte(&HAC)
        fs.WriteByte(&HC3)
        fs.WriteByte(&H4B)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HC4)
        fs.WriteByte(&HC4)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HC7)
        fs.WriteByte(&H81)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H71)
        fs.WriteByte(&H37)
        fs.WriteByte(&H72)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H24)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H2B)
        fs.WriteByte(&HCE)
        fs.WriteByte(&H0)
        fs.WriteByte(&H75)
        fs.WriteByte(&H3)
        fs.WriteByte(&HCF)
        fs.WriteByte(&H68)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H26)
        fs.WriteByte(&H8)
        fs.WriteByte(&HD8)
        fs.WriteByte(&H1)
        fs.WriteByte(&H2)
        fs.WriteByte(&H92)
        fs.WriteByte(&HD0)
        fs.WriteByte(&H76)
        fs.WriteByte(&HC6)
        fs.WriteByte(&H5F)
        fs.WriteByte(&H2)
        fs.WriteByte(&H64)
        fs.WriteByte(&H90)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HCE)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H6E)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H64)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H34)
        fs.WriteByte(&HD3)
        fs.WriteByte(&H24)
        fs.WriteByte(&HEE)
        fs.WriteByte(&H37)
        fs.WriteByte(&HE6)
        fs.WriteByte(&H38)
        fs.WriteByte(&H3)
        fs.WriteByte(&H9)
        fs.WriteByte(&H8D)
        fs.WriteByte(&HDE)
        fs.WriteByte(&HDF)
        fs.WriteByte(&H9B)
        fs.WriteByte(&HCF)
        fs.WriteByte(&H7)
        fs.WriteByte(&H83)
        fs.WriteByte(&HE4)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H9D)
        fs.WriteByte(&H92)
        fs.WriteByte(&H27)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HB)
        fs.WriteByte(&HC1)
        fs.WriteByte(&H82)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB5)
        fs.WriteByte(&H20)
        fs.WriteByte(&H14)
        fs.WriteByte(&HC4)
        fs.WriteByte(&HC4)
        fs.WriteByte(&H9A)
        fs.WriteByte(&HC3)
        fs.WriteByte(&H87)
        fs.WriteByte(&H10)
        fs.WriteByte(&H23)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H48)
        fs.WriteByte(&HB1)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H44)
        fs.WriteByte(&H5)
        fs.WriteByte(&H11)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteSearch(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H40)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H50)
        fs.WriteByte(&HA0)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HC5)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H41)
        fs.WriteByte(&H28)
        fs.WriteByte(&H6)
        fs.WriteByte(&HC5)
        fs.WriteByte(&H41)
        fs.WriteByte(&H9C)
        fs.WriteByte(&HC2)
        fs.WriteByte(&HA8)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HA7)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H7E)
        fs.WriteByte(&HA)
        fs.WriteByte(&HB8)
        fs.WriteByte(&H2)
        fs.WriteByte(&HC6)
        fs.WriteByte(&H49)
        fs.WriteByte(&H24)
        fs.WriteByte(&H22)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H1F)
        fs.WriteByte(&H85)
        fs.WriteByte(&H97)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H70)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H10)
        fs.WriteByte(&H7)
        fs.WriteByte(&H23)
        fs.WriteByte(&HD3)
        fs.WriteByte(&H9)
        fs.WriteByte(&H21)
        fs.WriteByte(&H24)
        fs.WriteByte(&H84)
        fs.WriteByte(&H4E)
        fs.WriteByte(&H80)
        fs.WriteByte(&H15)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H5A)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HD8)
        fs.WriteByte(&HAC)
        fs.WriteByte(&H76)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HED)
        fs.WriteByte(&H5E)
        fs.WriteByte(&H5)
        fs.WriteByte(&HB5)
        fs.WriteByte(&H85)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H93)
        fs.WriteByte(&HA7)
        fs.WriteByte(&HE2)
        fs.WriteByte(&H5B)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H18)
        fs.WriteByte(&H30)
        fs.WriteByte(&H1D)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H4)
        fs.WriteByte(&HC0)
        fs.WriteByte(&HB1)
        fs.WriteByte(&H19)
        fs.WriteByte(&H20)
        fs.WriteByte(&HC6)
        fs.WriteByte(&H49)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HF6)
        fs.WriteByte(&HE)
        fs.WriteByte(&H46)
        fs.WriteByte(&H40)
        fs.WriteByte(&HF0)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H68)
        fs.WriteByte(&H66)
        fs.WriteByte(&H83)
        fs.WriteByte(&H84)
        fs.WriteByte(&H65)
        fs.WriteByte(&H82)
        fs.WriteByte(&H85)
        fs.WriteByte(&H88)
        fs.WriteByte(&H89)
        fs.WriteByte(&H22)
        fs.WriteByte(&H87)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H83)
        fs.WriteByte(&H8C)
        fs.WriteByte(&H22)
        fs.WriteByte(&H7F)
        fs.WriteByte(&H1)
        fs.WriteByte(&H39)
        fs.WriteByte(&H48)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H4)
        fs.WriteByte(&H6F)
        fs.WriteByte(&H21)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H27)
        fs.WriteByte(&H3)
        fs.WriteByte(&H41)
        fs.WriteByte(&H44)
        fs.WriteByte(&H7)
        fs.WriteByte(&H44)
        fs.WriteByte(&H51)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H3)
        fs.WriteByte(&H51)
        fs.WriteByte(&H7F)
        fs.WriteByte(&H3)
        fs.WriteByte(&H4)
        fs.WriteByte(&H29)
        fs.WriteByte(&H52)
        fs.WriteByte(&H60)
        fs.WriteByte(&H36)
        fs.WriteByte(&H23)
        fs.WriteByte(&H76)
        fs.WriteByte(&H9D)
        fs.WriteByte(&H31)
        fs.WriteByte(&H26)
        fs.WriteByte(&H6)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H47)
        fs.WriteByte(&H2)
        fs.WriteByte(&H7C)
        fs.WriteByte(&H75)
        fs.WriteByte(&H4)
        fs.WriteByte(&H95)
        fs.WriteByte(&H92)
        fs.WriteByte(&H6E)
        fs.WriteByte(&HB5)
        fs.WriteByte(&H1)
        fs.WriteByte(&H50)
        fs.WriteByte(&HA9)
        fs.WriteByte(&H61)
        fs.WriteByte(&H8E)
        fs.WriteByte(&HC0)
        fs.WriteByte(&H86)
        fs.WriteByte(&HAA)
        fs.WriteByte(&H69)
        fs.WriteByte(&HC1)
        fs.WriteByte(&HC5)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H34)
        fs.WriteByte(&HB)
        fs.WriteByte(&HA)
        fs.WriteByte(&HCA)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HCE)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HD0)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HD2)
        fs.WriteByte(&HCF)
        fs.WriteByte(&H54)
        fs.WriteByte(&H5E)
        fs.WriteByte(&HD6)
        fs.WriteByte(&HD7)
        fs.WriteByte(&HD8)
        fs.WriteByte(&H5B)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HC6)
        fs.WriteByte(&HDC)
        fs.WriteByte(&H81)
        fs.WriteByte(&HDB)
        fs.WriteByte(&HDD)
        fs.WriteByte(&HE0)
        fs.WriteByte(&H90)
        fs.WriteByte(&HE0)
        fs.WriteByte(&HC5)
        fs.WriteByte(&HE2)
        fs.WriteByte(&H70)
        fs.WriteByte(&H3A)
        fs.WriteByte(&HA7)
        fs.WriteByte(&HE3)
        fs.WriteByte(&HBB)
        fs.WriteByte(&H2E)
        fs.WriteByte(&HE5)
        fs.WriteByte(&HBC)
        fs.WriteByte(&H27)
        fs.WriteByte(&H9F)
        fs.WriteByte(&H41)
        fs.WriteByte(&H74)
        fs.WriteByte(&H73)
        fs.WriteByte(&H7C)
        fs.WriteByte(&H3A)
        fs.WriteByte(&HB1)
        fs.WriteByte(&H44)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H93)
        fs.WriteByte(&HE7)
        fs.WriteByte(&H4)
        fs.WriteByte(&H5)
        fs.WriteByte(&HF3)
        fs.WriteByte(&H3A)
        fs.WriteByte(&HF0)
        fs.WriteByte(&H23)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H22)
        fs.WriteByte(&H4)
        fs.WriteByte(&HDC)
        fs.WriteByte(&H33)
        fs.WriteByte(&H95)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H89)
        fs.WriteByte(&H1C)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H4E)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H64)
        fs.WriteByte(&H8A)
        fs.WriteByte(&H31)
        fs.WriteByte(&H62)
        fs.WriteByte(&H57)
        fs.WriteByte(&H2F)
        fs.WriteByte(&H6F)
        fs.WriteByte(&HBF)
        fs.WriteByte(&H56)
        fs.WriteByte(&HE4)
        fs.WriteByte(&HBB)
        fs.WriteByte(&H64)
        fs.WriteByte(&H69)
        fs.WriteByte(&H13)
        fs.WriteByte(&H3E)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H9)
        fs.WriteByte(&H62)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H9)
        fs.WriteByte(&H41)
        fs.WriteByte(&H50)
        fs.WriteByte(&H7)
        fs.WriteByte(&H0)
        fs.WriteByte(&H87)
        fs.WriteByte(&H77)
        fs.WriteByte(&H1F)
        fs.WriteByte(&H20)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H1A)
        fs.WriteByte(&H47)
        fs.WriteByte(&HEE)
        fs.WriteByte(&H1B)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H92)
        fs.WriteByte(&H11)
        fs.WriteByte(&H4F)
        fs.WriteByte(&H6)
        fs.WriteByte(&H3)
        fs.WriteByte(&HA8)
        fs.WriteByte(&HB2)
        fs.WriteByte(&HD0)
        fs.WriteByte(&H14)
        fs.WriteByte(&H1)
        fs.WriteByte(&H30)
        fs.WriteByte(&H63)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H49)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H38)
        fs.WriteByte(&H69)
        fs.WriteByte(&H2A)
        fs.WriteByte(&H88)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteSearchA(ByVal fs As FileStream)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H0)
        fs.WriteByte(&H33)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H99)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&H66)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H66)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HCC)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3F)
        fs.WriteByte(&H0)
        fs.WriteByte(&H1B)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H4)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HF0)
        fs.WriteByte(&H94)
        fs.WriteByte(&H49)
        fs.WriteByte(&HAB)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H38)
        fs.WriteByte(&HEB)
        fs.WriteByte(&H6D)
        fs.WriteByte(&H4F)
        fs.WriteByte(&HF2)
        fs.WriteByte(&H49)
        fs.WriteByte(&H28)
        fs.WriteByte(&H8E)
        fs.WriteByte(&H64)
        fs.WriteByte(&H69)
        fs.WriteByte(&H9E)
        fs.WriteByte(&H68)
        fs.WriteByte(&H3A)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H86)
        fs.WriteByte(&HA7)
        fs.WriteByte(&HBC)
        fs.WriteByte(&H70)
        fs.WriteByte(&H2C)
        fs.WriteByte(&HCF)
        fs.WriteByte(&H74)
        fs.WriteByte(&H6D)
        fs.WriteByte(&HDF)
        fs.WriteByte(&HF0)
        fs.WriteByte(&HD7)
        fs.WriteByte(&H26)
        fs.WriteByte(&H78)
        fs.WriteByte(&HEF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H35)
        fs.WriteByte(&H9D)
        fs.WriteByte(&HB)
        fs.WriteByte(&H48)
        fs.WriteByte(&H2C)
        fs.WriteByte(&HDA)
        fs.WriteByte(&H84)
        fs.WriteByte(&H3C)
        fs.WriteByte(&HA3)
        fs.WriteByte(&H72)
        fs.WriteByte(&H89)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H3A)
        fs.WriteByte(&H8B)
        fs.WriteByte(&HCD)
        fs.WriteByte(&HA7)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H17)
        fs.WriteByte(&H9D)
        fs.WriteByte(&H5A)
        fs.WriteByte(&H69)
        fs.WriteByte(&H55)
        fs.WriteByte(&H18)
        fs.WriteByte(&H21)
        fs.WriteByte(&H80)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H1E)
        fs.WriteByte(&HAE)
        fs.WriteByte(&H32)
        fs.WriteByte(&H42)
        fs.WriteByte(&H17)
        fs.WriteByte(&H80)
        fs.WriteByte(&HCB)
        fs.WriteByte(&HBE)
        fs.WriteByte(&HBA)
        fs.WriteByte(&H68)
        fs.WriteByte(&HC4)
        fs.WriteByte(&H17)
        fs.WriteByte(&HFC)
        fs.WriteByte(&H12)
        fs.WriteByte(&H23)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H37)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H9B)
        fs.WriteByte(&HA0)
        fs.WriteByte(&H18)
        fs.WriteByte(&H20)
        fs.WriteByte(&H6)
        fs.WriteByte(&H6D)
        fs.WriteByte(&H74)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2E)
        fs.WriteByte(&H40)
        fs.WriteByte(&HF)
        fs.WriteByte(&HE8)
        fs.WriteByte(&H7)
        fs.WriteByte(&H8)
        fs.WriteByte(&H1)
        fs.WriteByte(&H81)
        fs.WriteByte(&H74)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H77)
        fs.WriteByte(&H74)
        fs.WriteByte(&H73)
        fs.WriteByte(&H76)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H33)
        fs.WriteByte(&H66)
        fs.WriteByte(&HA)
        fs.WriteByte(&H7A)
        fs.WriteByte(&H7)
        fs.WriteByte(&H74)
        fs.WriteByte(&HA)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H0)
        fs.WriteByte(&H81)
        fs.WriteByte(&H78)
        fs.WriteByte(&H6E)
        fs.WriteByte(&H7E)
        fs.WriteByte(&HA)
        fs.WriteByte(&H95)
        fs.WriteByte(&H5D)
        fs.WriteByte(&H75)
        fs.WriteByte(&H69)
        fs.WriteByte(&H8)
        fs.WriteByte(&H4)
        fs.WriteByte(&H97)
        fs.WriteByte(&H68)
        fs.WriteByte(&H91)
        fs.WriteByte(&H32)
        fs.WriteByte(&H8D)
        fs.WriteByte(&H4)
        fs.WriteByte(&H76)
        fs.WriteByte(&H68)
        fs.WriteByte(&H5F)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H1)
        fs.WriteByte(&HA)
        fs.WriteByte(&H0)
        fs.WriteByte(&H5D)
        fs.WriteByte(&H4)
        fs.WriteByte(&H95)
        fs.WriteByte(&H92)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H81)
        fs.WriteByte(&H9E)
        fs.WriteByte(&HB0)
        fs.WriteByte(&H8)
        fs.WriteByte(&H2)
        fs.WriteByte(&HA)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H90)
        fs.WriteByte(&H5D)
        fs.WriteByte(&H2)
        fs.WriteByte(&H73)
        fs.WriteByte(&H58)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H43)
        fs.WriteByte(&H34)
        fs.WriteByte(&H7)
        fs.WriteByte(&HA6)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H9D)
        fs.WriteByte(&HB6)
        fs.WriteByte(&HAE)
        fs.WriteByte(&HB2)
        fs.WriteByte(&H8)
        fs.WriteByte(&H99)
        fs.WriteByte(&H9B)
        fs.WriteByte(&HA)
        fs.WriteByte(&H7D)
        fs.WriteByte(&HC8)
        fs.WriteByte(&H31)
        fs.WriteByte(&H93)
        fs.WriteByte(&HAC)
        fs.WriteByte(&HB3)
        fs.WriteByte(&H8C)
        fs.WriteByte(&HBE)
        fs.WriteByte(&H49)
        fs.WriteByte(&H30)
        fs.WriteByte(&HB2)
        fs.WriteByte(&H80)
        fs.WriteByte(&H63)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H78)
        fs.WriteByte(&H31)
        fs.WriteByte(&H95)
        fs.WriteByte(&HB9)
        fs.WriteByte(&HC8)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H85)
        fs.WriteByte(&H82)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HAD)
        fs.WriteByte(&HBD)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H32)
        fs.WriteByte(&HD0)
        fs.WriteByte(&H69)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HA0)
        fs.WriteByte(&H77)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H5F)
        fs.WriteByte(&HB2)
        fs.WriteByte(&HC9)
        fs.WriteByte(&HDA)
        fs.WriteByte(&HC3)
        fs.WriteByte(&HA1)
        fs.WriteByte(&HE3)
        fs.WriteByte(&HD1)
        fs.WriteByte(&HA3)
        fs.WriteByte(&HD3)
        fs.WriteByte(&H33)
        fs.WriteByte(&HA5)
        fs.WriteByte(&HA7)
        fs.WriteByte(&H30)
        fs.WriteByte(&HCC)
        fs.WriteByte(&HE2)
        fs.WriteByte(&HB4)
        fs.WriteByte(&H6A)
        fs.WriteByte(&HAD)
        fs.WriteByte(&HDF)
        fs.WriteByte(&H56)
        fs.WriteByte(&H19)
        fs.WriteByte(&HAA)
        fs.WriteByte(&H45)
        fs.WriteByte(&HB)
        fs.WriteByte(&H0)
        fs.WriteByte(&H34)
        fs.WriteByte(&H51)
        fs.WriteByte(&H31)
        fs.WriteByte(&H1A)
        fs.WriteByte(&HB1)
        fs.WriteByte(&H99)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H70)
        fs.WriteByte(&HE1)
        fs.WriteByte(&H93)
        fs.WriteByte(&H86)
        fs.WriteByte(&HE)
        fs.WriteByte(&H99)
        fs.WriteByte(&HDC)
        fs.WriteByte(&H8B)
        fs.WriteByte(&H78)
        fs.WriteByte(&H5)
        fs.WriteByte(&H22)
        fs.WriteByte(&H45)
        fs.WriteByte(&H28)
        fs.WriteByte(&H13)
        fs.WriteByte(&H2F)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H41)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HA3)
        fs.WriteByte(&HC7)
        fs.WriteByte(&H8F)
        fs.WriteByte(&H28)
        fs.WriteByte(&H1E)
        fs.WriteByte(&H7C)
        fs.WriteByte(&H1D)
        fs.WriteByte(&H18)
        fs.WriteByte(&H49)
        fs.WriteByte(&HB2)
        fs.WriteByte(&HA4)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H93)
        fs.WriteByte(&H28)
        fs.WriteByte(&H53)
        fs.WriteByte(&HAA)
        fs.WriteByte(&H5C)
        fs.WriteByte(&H79)
        fs.WriteByte(&HD2)
        fs.WriteByte(&H40)
        fs.WriteByte(&H2)
        fs.WriteByte(&H3)
        fs.WriteByte(&H30)
        fs.WriteByte(&H63)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H9C)
        fs.WriteByte(&H49)
        fs.WriteByte(&HB3)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HCD)
        fs.WriteByte(&H9B)
        fs.WriteByte(&H38)
        fs.WriteByte(&H6B)
        fs.WriteByte(&H46)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)

    End Sub

    Private Sub WriteCalendarDotGifToFileStream(ByVal fs As FileStream)
        'fs.WriteByte(&H1)
        fs.WriteByte(&H47)
        fs.WriteByte(&H49)
        fs.WriteByte(&H46)
        fs.WriteByte(&H38)
        fs.WriteByte(&H39)
        fs.WriteByte(&H61)
        fs.WriteByte(&H10)
        fs.WriteByte(&H0)
        fs.WriteByte(&H10)
        fs.WriteByte(&H0)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&HA5)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H4D)
        fs.WriteByte(&HA5)
        fs.WriteByte(&H4A)
        fs.WriteByte(&H4D)
        fs.WriteByte(&H4A)
        fs.WriteByte(&HA5)
        fs.WriteByte(&HA6)
        fs.WriteByte(&HA5)
        fs.WriteByte(&HD6)
        fs.WriteByte(&HD3)
        fs.WriteByte(&HD6)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&HFF)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H21)
        fs.WriteByte(&HF9)
        fs.WriteByte(&H4)
        fs.WriteByte(&H1)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H6)
        fs.WriteByte(&H0)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H10)
        fs.WriteByte(&H0)
        fs.WriteByte(&H10)
        fs.WriteByte(&H0)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3)
        fs.WriteByte(&H44)
        fs.WriteByte(&H68)
        fs.WriteByte(&HBA)
        fs.WriteByte(&HDC)
        fs.WriteByte(&H36)
        fs.WriteByte(&H30)
        fs.WriteByte(&HCA)
        fs.WriteByte(&H29)
        fs.WriteByte(&H46)
        fs.WriteByte(&HB8)
        fs.WriteByte(&H38)
        fs.WriteByte(&H4C)
        fs.WriteByte(&H58)
        fs.WriteByte(&H33)
        fs.WriteByte(&HDE)
        fs.WriteByte(&H43)
        fs.WriteByte(&H55)
        fs.WriteByte(&H14)
        fs.WriteByte(&HC4)
        fs.WriteByte(&H58)
        fs.WriteByte(&H92)
        fs.WriteByte(&HE6)
        fs.WriteByte(&H28)
        fs.WriteByte(&HA2)
        fs.WriteByte(&HEC)
        fs.WriteByte(&H79)
        fs.WriteByte(&H56)
        fs.WriteByte(&H44)
        fs.WriteByte(&H2C)
        fs.WriteByte(&HC7)
        fs.WriteByte(&H40)
        fs.WriteByte(&HD)
        fs.WriteByte(&HC4)
        fs.WriteByte(&HAB)
        fs.WriteByte(&H3B)
        fs.WriteByte(&H2)
        fs.WriteByte(&HBB)
        fs.WriteByte(&H3A)
        fs.WriteByte(&HA4)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H5E)
        fs.WriteByte(&H41)
        fs.WriteByte(&H8)
        fs.WriteByte(&H9B)
        fs.WriteByte(&HC9)
        fs.WriteByte(&H6C)
        fs.WriteByte(&H37)
        fs.WriteByte(&H42)
        fs.WriteByte(&HE)
        fs.WriteByte(&HA8)
        fs.WriteByte(&H2B)
        fs.WriteByte(&H2C)
        fs.WriteByte(&H5B)
        fs.WriteByte(&HC0)
        fs.WriteByte(&HA2)
        fs.WriteByte(&H71)
        fs.WriteByte(&HAA)
        fs.WriteByte(&HFC)
        fs.WriteByte(&H41)
        fs.WriteByte(&HAF)
        fs.WriteByte(&HCF)
        fs.WriteByte(&HE6)
        fs.WriteByte(&H4B)
        fs.WriteByte(&HC0)
        fs.WriteByte(&HED)
        fs.WriteByte(&H7A)
        fs.WriteByte(&HBF)
        fs.WriteByte(&H82)
        fs.WriteByte(&H4)
        fs.WriteByte(&H0)
        fs.WriteByte(&H3B)
    End Sub


    Private Sub Logit(ByVal s As String)
        MasterForm.txtOutput.Text = s & vbCrLf & MasterForm.txtOutput.Text
    End Sub

    Private Sub cmdCloseButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdCloseButton.Click
        Dim parent As TabControl = Me.Parent
        parent.TabPages.Remove(Me)
    End Sub

    Private Sub ProcessDemoMode()
        Dim CodeTypes() As String = {"CS", "VB"}
        Dim CodeTypesKeys() As String = {"CS2005", "VB2005"}

        Dim GridCodingStyles() As String = {"GridView", "Repeater", "CodeBehind"}

        Dim EditKeyPassings() As String = {"Session", "Request", "Inline"}

        Dim Pagings() As String = {"NoPaging", "BasicPaging", "HighSpeedPaging"}
        Dim PagingsKeys() As String = {"None", "Basic", "HighSpeed"}

        For CodeTypeIndex As Long = 0 To CodeTypes.Length - 1
            For GridCodingStyleIndex As Long = 0 To GridCodingStyles.Length - 1
                For Each KeyPass As String In EditKeyPassings
                    For PagingsIndex As Long = 0 To PagingsKeys.Length - 1
                        Dim ProcessFile As Boolean = True
                        Dim Prefix As String = CodeTypes(CodeTypeIndex) & GridCodingStyles(GridCodingStyleIndex) & KeyPass & Pagings(PagingsIndex)
                        Dim PagingKey As String = PagingsKeys(PagingsIndex)
                        Dim GridCodingStyle As String = GridCodingStyles(GridCodingStyleIndex)
                        Dim CodeType As String = CodeTypesKeys(CodeTypeIndex)

                        'Grid View only, Basic Paging only.
                        Select Case PagingKey
                            Case "BasicPaging"
                                Select Case GridCodingStyle
                                    Case "GridView"
                                    Case Else
                                        ProcessFile = False
                                End Select
                        End Select

                        If ProcessFile Then
                            Dim pcg As New RawCreateScript(gTableName, dt, MasterForm.cboConnectionStringType.SelectedValue, MasterForm.txtConnectionString.Text, _
                                                           GridCodingStyle, True, _
                                                           CodeType, _
                                                           MasterForm.txtProjectName.Text, _
                                                           KeyPass, _
                                                           MasterForm.cboCommentLevel.SelectedValue, _
                                                           PagingKey, _
                                                           MasterForm.chkSorting.Checked, _
                                                           Prefix, gSchemaName)

                            If Support.DownloadFile(pcg, MasterForm.txtPath.Text & "\", MasterForm.txtOutput) = False Then
                                'error happened
                                ' Exit Sub
                            End If
                        End If
                    Next
                Next
            Next
        Next
        'For Each CodeType As String In CodeTypes
        '    For Each GridCodingStyle As String In GridCodingStyles
        '        For Each editKeyPassing As String In EditKeyPassings

        '            For Each Paging As String In Pagings
        '                Dim pcg As New RawCreateScript(gTableName, dt, MasterForm.cboConnectionStringType.SelectedValue, MasterForm.txtConnectionString.Text, MasterForm.cboGridCodingStyle.SelectedValue, True, MasterForm.cboCodeType.SelectedValue, MasterForm.txtProjectName.Text, MasterForm.cboKeyPassing.SelectedValue, MasterForm.cboCommentLevel.SelectedValue, MasterForm.cboPaging.SelectedValue, MasterForm.chkSorting.Checked, "")
        '                If Support.DownloadFile(pcg, MasterForm.txtPath.Text & "\", MasterForm.txtOutput) = False Then
        '                    'error happened
        '                    Exit Sub
        '                End If
        '            Next
        '        Next
        '    Next
        'Next



    End Sub

    'Private Sub grd_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs) Handles grd.CellFormatting
    '    'If grd.Rows(e.RowIndex).Cells(1).Value = "datetime" Then
    '    '    grd.Rows(e.RowIndex).Cells(7).Style.BackColor = Color.LightGreen
    '    '    Dim dgvcbc As DataGridViewComboBoxCell = grd.Rows(e.RowIndex).Cells(7)
    '    '    dgvcbc.Items.Clear()
    '    '    dgvcbc.Items.AddRange(New Object() {"", "date", "datetime"})
    '    '    'dgvcbc.Items.Add("Test")
    '    '    'dgvcbc.data()


    '    '    'grd.Rows(e.RowIndex).Cells(7)

    '    '    '.Items.AddRange(New Object() {"", "Both", "Exact", "Left", "Right"})
    '    '    'grd.Rows(e.RowIndex).Cells(7).
    '    'End If

    '    'grd.Rows(e.RowIndex).Cells(e.ColumnIndex)
    'End Sub


    'Private Sub grd_CellMouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles grd.CellMouseMove
    '    If e.RowIndex = 7 Then
    '        Cursor.Current = Cursors.Hand
    '    Else
    '        Cursor.Current = Cursors.Default
    '    End If
    'End Sub

    'Private Sub grd_RowsAdded(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowsAddedEventArgs) Handles grd.RowsAdded
    '    Debug.WriteLine(grd.Rows(e.RowIndex).Cells(1).Value)
    '    If grd.Rows(e.RowIndex).Cells(1).Value = "datetime" Then
    '        grd.Rows(e.RowIndex).Cells(7).Style.BackColor = Color.LightGreen
    '        Dim dgvcbc As DataGridViewComboBoxCell = grd.Rows(e.RowIndex).Cells(7)
    '        dgvcbc.Items.Clear()
    '        dgvcbc.Items.AddRange(New Object() {"", "date", "datetime"})
    '        'dgvcbc.Items.Add("Test")
    '        'dgvcbc.data()


    '        'grd.Rows(e.RowIndex).Cells(7)

    '        '.Items.AddRange(New Object() {"", "Both", "Exact", "Left", "Right"})
    '        'grd.Rows(e.RowIndex).Cells(7).
    '    End If

    'End Sub

    Private Sub grd_DataBindingComplete(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles grd.DataBindingComplete
        For Each Row As DataGridViewRow In grd.Rows
            Dim dgvcbc As DataGridViewComboBoxCell = Row.Cells(7)
            If Row.Cells(1).Value = "datetime" Then
                If dgvcbc.Items.Count <> 2 Then
                    Row.Cells(7).Style.BackColor = Color.LightGreen

                    dgvcbc.Items.Clear()
                    Dim DefaultType As String = ""

                    Try

                        Dim FileName As String = PCGColumn.StaticSafeParameterName(Me.ServerName) & "." & PCGColumn.SafeParameterNameDotSpaceToUnderScore(Me.DatabaseName) & "." & PCGColumn.SafeParameterNameDotSpaceToUnderScore(gTableName) & ".xml"
                        Dim doc As XmlDocument = Nothing
                        If System.IO.File.Exists(FileName) Then
                            doc = New XmlDocument
                            doc.Load(FileName)
                            Dim Key As XmlElement = doc.DocumentElement
                            Dim Node As XmlNode = Key.SelectSingleNode("Column[@Name='" & Row.Cells(0).Value & "']")
                            If IsNothing(Node) = False Then
                                Dim DataFormatField As XmlNode = Node.SelectSingleNode("Field[@Name='DataFormat']")
                                If IsNothing(DataFormatField) = False Then
                                    DefaultType = DataFormatField.InnerText
                                End If
                            End If
                        End If
                    Catch ex As Exception

                    End Try

                    dgvcbc.Items.AddRange(New Object() {"date", "datetime"})

                    Try

                        If DefaultType.Length > 0 Then
                            dgvcbc.Value = DefaultType
                        End If
                    Catch ex As Exception

                    End Try
                    ''

                Else
                End If
            End If

        Next
    End Sub

    Private Sub SaveConfiguration()
        'dot.Databasename.Tablename
        Dim FileName As String = PCGColumn.StaticSafeParameterName(Me.ServerName) & "." & PCGColumn.SafeParameterNameDotSpaceToUnderScore(Me.DatabaseName) & "." & PCGColumn.SafeParameterNameDotSpaceToUnderScore(gTableName) & ".xml"
        If System.IO.File.Exists(FileName) Then
            If Support.IsFileReadOnly(FileName) Then
                UnWriteProtectFile(FileName)
            End If
            System.IO.File.Delete(FileName)
        End If

        Dim xmlDoc As New XmlDocument
        Dim xmlDeclaration As XmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "utf-8", "")
        xmlDoc.InsertBefore(xmlDeclaration, xmlDoc.DocumentElement)

        Dim Columns As XmlElement = xmlDoc.CreateElement("Columns")
        'RootNode.SetAttribute("Version", "1.0")
        xmlDoc.AppendChild(Columns)

        For Each row As DataRow In dt.Rows
            Dim Column As XmlElement = xmlDoc.CreateElement("Column")
            Column.SetAttribute("Name", row("columnname"))
            Columns.AppendChild(Column)

            'Column.AppendChild(xmlDoc.CreateTextNode("Test"))

            Dim Field As XmlElement = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "IsIdentity")
            Field.AppendChild(xmlDoc.CreateTextNode(row("IsIdentity")))
            Column.AppendChild(Field)

            Field = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "ShowInMasterView")
            Field.AppendChild(xmlDoc.CreateTextNode(row("ShowInMasterView")))
            Column.AppendChild(Field)


            Field = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "ShowInDetailView")
            Field.AppendChild(xmlDoc.CreateTextNode(row("ShowInDetailView")))
            Column.AppendChild(Field)

            Field = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "SearchType")
            Field.AppendChild(xmlDoc.CreateTextNode(row("SearchType").ToString))
            Column.AppendChild(Field)


            Field = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "LinkTableName")
            Field.AppendChild(xmlDoc.CreateTextNode(row("LinkTableName").ToString))
            Column.AppendChild(Field)

            Field = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "LinkTableKey")
            Field.AppendChild(xmlDoc.CreateTextNode(row("LinkTableKey").ToString))
            Column.AppendChild(Field)

            Field = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "LinkTableValue")
            Field.AppendChild(xmlDoc.CreateTextNode(row("LinkTableValue").ToString))
            Column.AppendChild(Field)


            Field = xmlDoc.CreateElement("Field")
            Field.SetAttribute("Name", "DataFormat")
            Field.AppendChild(xmlDoc.CreateTextNode(row("DataFormat").ToString))
            Column.AppendChild(Field)

            'row("LinkTableName").ToString, row("").ToString, row("").ToString, row("DataFormat").ToString
            'Debug.WriteLine(row("columnname"))
            'row("")

        Next

        'For Each csi As ConnectServerItem In Servers
        '    Dim Server As XmlElement = xmlDoc.CreateElement("Project")
        '    Server.SetAttribute("ProjectName", csi.ProjectName)
        '    Server.SetAttribute("ProjectPath", csi.ProjectPath)
        '    Server.SetAttribute("CodeType", csi.CodeType)
        '    'Server.SetAttribute("DatabaseType", csi.DatabaseType)
        '    Server.SetAttribute("CommentLevel", csi.CommentLevel)
        '    Server.SetAttribute("KeyPassing", csi.KeyPassing)
        '    Server.SetAttribute("GridCodingStyle", csi.GridCodingStyle)
        '    Server.SetAttribute("SourceCodeFiles", csi.SourceCodeFiles)
        '    'Server.SetAttribute("SupportFiles", csi.SupportFiles)
        '    Server.SetAttribute("WebConfigFile", csi.WebConfigFile)
        '    Server.SetAttribute("ConnectionStringStyle", csi.ConnectionStringStyle)
        '    Server.SetAttribute("ConnectionStringName", csi.ConnectionStringName)
        '    'Server.SetAttribute("AddImages", csi.AddImages)
        '    Server.SetAttribute("Paging", csi.Paging)
        '    Server.SetAttribute("Sorting", csi.Sorting)
        '    RootNode.AppendChild(Server)
        'Next
        'System.IO.File.Delete(FileName)
        xmlDoc.Save(FileName)
    End Sub

    ' used to determine which the column the popup menu was created with.
    Private MouseMenuColumnIndex As Integer = 0

    Private Sub grd_MouseDown(sender As Object, e As MouseEventArgs) Handles grd.MouseDown
        ' if there is a right click in the grid
        If e.Button = Windows.Forms.MouseButtons.Right Then

            ' position in the grid.
            Dim MousePosition As Point = grd.PointToClient(Control.MousePosition)
            ' cell in the grid.
            Dim MouseLocationInGrid As HitTestInfo = grd.HitTest(MousePosition.X, MousePosition.Y)

            ' form mouse position
            MousePosition = frmMaster.MousePosition

            Const MasterViewGridColumnIndex As Integer = 2
            Const DetailViewGridColumnIndex As Integer = 3
            Const MenuOffset As Integer = -5

            ' show a popup menu for the Master or Detail column.
            If (MouseLocationInGrid.ColumnIndex = MasterViewGridColumnIndex Or MouseLocationInGrid.ColumnIndex = DetailViewGridColumnIndex) Then

                'actuall show the popup menu.
                mnuSelector.Show(MousePosition.X + MenuOffset, MousePosition.Y + MenuOffset)

                ' store the location to be used when the popup menu is clicked.
                MouseMenuColumnIndex = MouseLocationInGrid.ColumnIndex
            End If
        End If
    End Sub

    Private Sub mnuClearAll_Click(sender As Object, e As EventArgs) Handles mnuClearAll.Click
        For Each Row As DataGridViewRow In grd.Rows
            Row.Cells(MouseMenuColumnIndex).Value = False
        Next
    End Sub

    Private Sub mnuSelectAll_Click(sender As Object, e As EventArgs) Handles mnuSelectAll.Click
        For Each Row As DataGridViewRow In grd.Rows
            Row.Cells(MouseMenuColumnIndex).Value = True
        Next
    End Sub

    Private Sub grd_CellValueChanged(sender As Object, e As DataGridViewCellEventArgs) Handles grd.CellValueChanged
        If e.ColumnIndex = 6 Then
            For i As Integer = 0 To grd.RowCount - 1
                If i = e.RowIndex Then
                    ' do nothing
                Else
                    'uncheck 
                    grd.Rows(i).Cells(6).Value = False

                End If
            Next
        End If
    End Sub
End Class
